Quick way to access a file on a DOS Windows floppy

Use "mtools", no mounting required. For example, I can use the mdir command to quickly inspect the content of the root directory on my DOS floppy.

mdir a:\

I can also use mcopy to copy the file "autoexec.bat" from the root directory on the floppy to my current directory on Linux:
mcopy a:\autoexec.bat .
You have to be root to be able to write to a floppy.
Type "mtools" to see the supported commands in the rich mtools set, which parallel the most popular DOS commands (for example: mformat, mtype, mren, mmove, mdel, mrd, mattib, ...), and use manual pages if you have problems using them. For example:
man mtype
will show me how to display a content of a text file on a DOS partition.

To access DOS drives other than a: or b:, you have to configure mtools so as to indicate which devices are associated with other DOS "drive letters".
This is quite easy--you just edit and modify the file /etc/mtools.conf. I typically use pico to do it (as root):
pico /etc/mtools.conf

For example, my /etc/mtools contains a line like this:
drive c: file="/dev/hda1"
which instructs the mtools that the partition "/dev/hda1" will be called "c:" The setup of /etc/mtools.conf requires just uncommenting (removing the "#" at the beginning of the line) and adjusting the appropriate entry.

Posted on: 07/10/2010

If you want to leave a comment please Login or Register