How to Manage MS-DOS Floppy Disks Using mtools in Linux

When you are attempting to recover data from an ancient MS-DOS computer or working with heavily specialized industrial hardware that still relies on FAT-formatted floppy disks, standard Linux mounting commands often fail or corrupt the delicate 16-bit filesystem. To safely interact with legacy MS-DOS filesystems without formally mounting the drive to the Linux kernel, you must use the mtools utility package.

What is the mtools Package?

The mtools suite is a massive collection of dedicated command-line utilities specifically engineered to emulate standard MS-DOS commands natively within the Linux terminal. Because it interacts with the raw block device rather than the kernel’s virtual filesystem, it completely bypasses standard Linux file permission errors, making it the safest way to read and write to fragile FAT12 and FAT16 floppy disks.

Because it is highly specialized, it is not installed by default on most modern distributions. To install it on Ubuntu or Debian, run:

sudo apt install mtools

How to Read an MS-DOS Disk

Once the package is installed, you gain access to an entire suite of commands that mirror classic DOS (e.g., mdir instead of ls, mcopy instead of cp, and mdel instead of rm).

Assuming you have a physical USB floppy drive plugged into your server, Linux will likely assign it the block device name /dev/fd0.

To view the directory contents of the floppy disk exactly as an old MS-DOS machine would see it, run the mdir command targeting the device:

mdir -i /dev/fd0 ::

The -i flag manually points the tool at the physical floppy drive, and the double-colon (::) represents the root directory of the MS-DOS filesystem. The terminal will instantly output a classic DOS-style directory listing, displaying the legacy 8.3 character file names.

How to Transfer Files (Push and Pull)

To safely pull an ancient text file off the floppy disk and save it to your modern Linux desktop, you must use the mcopy command.

mcopy -i /dev/fd0 ::/OLD_DOC.TXT /home/user/Desktop/

This command flawlessly bridges the gap between the two completely different operating systems, translating the file encoding and dropping the document directly onto your modern desktop.

To push a brand new file from your Linux machine back onto the floppy disk (perhaps a firmware update file required by a piece of legacy industrial machinery), you simply reverse the syntax:

mcopy -i /dev/fd0 /home/user/Desktop/update.bin ::/UPDATE.BIN

By relying entirely on the mtools suite, you guarantee that the fragile MS-DOS FAT architecture remains perfectly intact and fully readable by the legacy hardware.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.