Linux-Windows file access

By Richard Sharpe, |  Networking, Linux

You can mount floppies in just the same way as you might a Windows partition on your hard disk:

mount -t vfat /dev/fd0 /mnt/floppy

Indeed, with modern Linux distributions, you can leave out the -t vfat and Linux will figure out the correct type. Another useful shortcut is to simply type mount /dev/fd0, because the Linux mount command can retrieve the rest of the information needed to mount the floppy from /etc/fstab. For more information about the mount and umount commands see man mount and man umount, respectively.

I don't know about you, but I get very tired of having to mount floppies just to access the files on them. You also have to remember to umount the floppy when you have finished using it and want to use another floppy.

Fortunately, the mtools package, which installs with many Linux distributions these days, contains a series of commands that eliminates all this mounting and umounting of floppies. It contains a series of commands for dealing with MS-DOS formatted floppies including mdir to list the files on a floppy, mcopy to copy files to or from floppies, mdel, and so forth. Those commands are the same as the MS-DOS commands to manipulate floppies with an "m" added to the front of each command. You may have to install the mtools package from your installation CD. Under Red Hat 7.0, the package to install is mtools-3.9.7-3.i386.rpm.

Listing 4 shows an example of using commands from the mtools package to list the contents of a floppy and copy files from the floppy to the user's current directory. For more information about the mtools package, try man mtools.

If you have a mixed network of Windows and Linux systems, you may want to mount file systems from your Windows systems on your Linux machine. You can do that with the smbmount command, but since smbmount command is called from the mount command, it is just as easy to use mount.

Listing 5 shows an example of mounting the C drive from my Windows 95 system running under VMware as /mnt/win9x.

Join us:






Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Ask a Question