[SOLVED] Mysterious flag for mcopy on the wiki

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Binero
Posts: 15
Joined: Mon Mar 03, 2014 1:00 pm

[SOLVED] Mysterious flag for mcopy on the wiki

Post by Binero »

On the Wiki page explaining how to work for UEFI, there is a mysterious "-i" flag being used for the command mcopy. What does this parameter do? It's no where to be found in the manuals. Also I am quite puzzled about what the "::" is doing at the end of the command.

Page: http://wiki.osdev.org/UEFI#Making_a_disk_image_manually

Thanks in advance!
Last edited by Binero on Sat Aug 23, 2014 1:05 pm, edited 1 time in total.
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: Mysterious flag for mcopy on the wiki

Post by Nable »

man mtools wrote:

Code: Select all

   Drive letters
       The meaning of the drive letters depends on the  target  architectures.
       However,  on  most  target  architectures,  drive A is the first floppy
       drive, drive B is the second floppy drive (if available), drive J is  a
       Jaz  drive  (if  available), and drive Z is a Zip drive (if available).
       On those systems where the device name is derived from the SCSI id, the
       Jaz drive is assumed to be at SCSI target 4, and the Zip at SCSI target
       5 (factory default settings).  On Linux, both drives are assumed to  be
       the  second  drive on the SCSI bus (/dev/sdb). The default settings can
       be changes using a configuration file (see section  Configuration).

       The drive letter : (colon) has a special meaning. It is used to  access
       image  files which are directly specified on the command line using the
       -i options.

       Example:

           mcopy -i my-image-file.bin ::file1 ::file2 .

       This copies file1 and file2 from the image file (my-image-file.bin)  to
       the /tmp directory.

       You can also supply an offset within the image file by including @@off‐
       set into the file name.

       Example:

           mcopy -i my-image-file.bin@@1M ::file1 ::file2 .

       This looks for the image at the offset of 1M in the file,  rather  than
       at its beginning.
User avatar
voidf0xb3
Posts: 7
Joined: Fri Mar 16, 2012 11:32 am
Location: Moscow, Russia

Re: Mysterious flag for mcopy on the wiki

Post by voidf0xb3 »

Mtools allow you to access FAT filesystems with paths using this Windows-like syntax, e.g. "c:/path/to/myfile.bin". There are configuration files that specify where you can find the drives "a:", "b:", "c:", etc. If there's a colon instead of the drive name ("::"), it simply refers to the root of the filesystem in the image file that you specify with the -i option. This works with all mtools commands, not just mcopy.

Example:

Code: Select all

mcopy -i ./fat.img ./myfile.bin ::/myfile.bin
This copies the file ./myfile.bin to the root of the filesystem contained in the file ./fat.img.
Binero
Posts: 15
Joined: Mon Mar 03, 2014 1:00 pm

Re: [SOLVED] Mysterious flag for mcopy on the wiki

Post by Binero »

Thanks guys!
Post Reply