FLOPPIX | Home | FAQ | Download | Labs | ToC | Back | Next |
Floppix is configured so that ordinary users can save data on diskettes formatted with a DOS or Windows95 filesystem. There are a few key points to remember:
Linux works with a single logical filesystem which can actually be stored on several physical devices. For example:
the root directory, binaries, libraries and system configuration files may be stored on one hard drive;
the home directories for the users may be stored on a second hard drive ;
the spool files (mail, print, ... ) may be stored on a 3rd hard drive.
/ |-----|-----|------|-----| bin etc home usr var | | |---------| spool abc xyz
The system administrator will make sure that all devices are "mounted" (inserted into the logical filesystem) when the system boots. Users can move from their own home directory to the /etc directory to /var/spool without worrying about whether or not they are changing from one drive to another. Normally this gives the system administrator the power to add or change the storage devices transparently - an ordinary user doesn't have to worry about the physical organization of the storage system.
Removable storage devices (such as diskettes and cd-roms) are the fly in the ointment. They cannot be mounted when the system boots because you may want to change disks several times. Therefore, you must tell the operating system when you insert or remove a diskette; otherwise, the data will NOT be written on the floppy.
On floppix, you can mount a diskette formatted under DOS or Windows95 on the /floppy directory using the command: mount /floppy. The operating system will check in the configuration file for the mount command (/etc/fstab) to see what device should be mounted (/dev/fd0); what type of filesystem is on the diskette (vfat) and whether or not ordinary users are allowed to mount floppies (on floppix, the answer is yes but normally only the superuser can mount devices).
While the diskette is mounted, any files that you copy to the /floppy directory
will be copied to the diskette. After the diskette is umounted, the /floppy
directory no longer points to the diskette. You can check to see whether
or not the diskette is mounted by entering the command: mount. If
the floppy is mounted, then the output from mount will be:
/dev/ram on / type ext2 (rw)
proc on /proc type proc (rw)
/dev/ram1 on /usr type ext2 (rw)
/dev/fd0 on /floppy type vfat (rw,nosuid,nodev,user=abc)
As long as the last line (/dev/fd0 on /floppy ... ) is present,
then anything you save in the /floppy directory will be saved on the floppy
drive. If the line is not present, then you are not writing to the
floppy drive.
When you want to eject the floppy, you must tell the operating system before removing the diskette. First, run the sync command. This flushes any data that is stored in the disk cache so that it is physically written to disk. Then, enter the command: umount /floppy. Because linux is a multi-user operating system, the system will check to make sure that none of the users on the system are using the floppy and will NOT unmount the diskette if anyone is using it. If you get the error message: device is busy, then one of the users on your system is still using the diskette. On floppix, that user is probably you! If your working directory is /floppy, then you are still using the diskette and the operating system will not let you unmount it.
Summary: how to save files on a diskette
Copyright © L. M. MacEwan
FLOPPIX | Home | FAQ | Download | Labs | ToC | Back | Next |