Linux Know-How provides a collection of introductory texts on often needed Linux skills.


Accessing a file on a DOS/Windows floppy

Use "mtools", no mounting required. For example, I can use the mdir command to quickly inspect the contents 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, mattrib, ...), and use manual pages if you have problems using them. For example:

man mtype

will show me how to display the contents 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.


Last Update: 2010-12-16