Mtools is a collection of tools to allow Unix systems to manipulate MS-DOS based filesystems, such as FAT. It provides command-line utilities to read, write, and move files on an MS-DOS filesystem. Mtools is not capable of facilitating mounting an MS-DOS disk image to the host system. One common use for Mtools is to copy files to a FAT disk image located on the host system.
Using disk images
The -i option, followed by a disk images file name, allows for using a disk image in place of a real device when the drive letter : is used.
For example to copy the file kernel.elf from the working directory to the root directory of the image floppy.img one would use
mcopy -i floppy.img kernel.elf ::/
It is important to notice that, while MTools claims to include only the minimal BIOS Parameter Block (BPB), it actually uses the FAT16 extension (see e.g.  under 'FAT16' for an explanation) to the BPB if you format a FAT12 image.
- https://www.gnu.org/software/mtools/ Mtools home page.
- https://linux.die.net/man/1/mtools Mtools Linux man entry.