command-linedosgnudiskgnu-toolchain

How to use GNU mtools to extract all files from a given disk image?


I understand that GNU mtools can be used to extact files from a DOS disk image. The example provided on the website shows how to extract a discrete number of files or directories from a disk image.

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.

How do I use this command to extract all files from an image (recursively)?


Solution

  • According to https://www.gnu.org/software/mtools/manual/html_node/mcopy.html it should be possible

    mcopy [-bspanvmQT] [-D clash_option] sourcefile [ sourcefiles… ] targetdirectory

    ...

    s Recursive copy. Also copies directories and their contents
    p Preserves the attributes of the copied files

    ...

    But it doesn't mention the -i in your example.