Page 1 of 1
[SOLVED] Mysterious flag for mcopy on the wiki
Posted: Sat Aug 23, 2014 11:26 am
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!
Re: Mysterious flag for mcopy on the wiki
Posted: Sat Aug 23, 2014 12:24 pm
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.
Re: Mysterious flag for mcopy on the wiki
Posted: Sat Aug 23, 2014 12:25 pm
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.
Re: [SOLVED] Mysterious flag for mcopy on the wiki
Posted: Sat Aug 23, 2014 1:05 pm
by Binero
Thanks guys!