Now that you've had some experience mounting different foreign filesystems, it should be a snap moving on to CD-ROMs and floppy drives. CD-ROMs usually are mounted as CD9660 filesystems, but floppies generally are either FFS (the FreeBSD standard) or MSDOS. Mounting CDs and FloppiesFor CD-ROMs, the main trick is to determine the device name. IDE drives will be of the form /dev/acd0c, SCSI drives will be of the form /dev/cd0c, and miscellaneous types of nonstandard drives have other prefixes. As for the suffix, use c to indicate that you are addressing the entire disk in "dedicated" mode. Here's an example: # mount_cd9660 /dev/acd0c /cdrom Tip See http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/disks-naming.html for the current reference to disk names.
Mounting a floppy disk is fairly straightforward. Use the device name /dev/fd0 (the zero specifies your first floppy drive). The kernel also contains a confusing entry for fdc0, which refers to the actual ISA floppy disk controller device, but fd0 and fd1 are the device names for the drives that hang off the controller. Here's how to mount a UNIX floppy disk: # mount /dev/fd0 /floppy An MS-DOS floppy can be mounted in a similar fashion: # mount_msdosfs /dev/fd0 /floppy Be careful: Floppy disks can be write protected and CD-ROMs are physically read-only, but FreeBSD does not check at mount time whether they are writable! If you mount a write-protected floppy without specifying the -r or rdonly option, you will get I/O errors whenever anything tries to write to the diskand what happens as a result can vary with the stability of whatever program is doing the writing. Anything from a simple console error message to a complete hang of the system can occur. Therefore, if you must mount a write-protected floppy or CD-ROM from the command line, make sure you specify the -r or rdonly option to prevent programs from even trying to write to it! Unmounting CDs and FloppiesThe other tricky thing about CD-ROMs and floppies is that because they are removable devices, there exists the potential to remove the disk while the system still thinks it is mounted. Windows (for comparison's sake) dynamically mounts and refreshes the devices whenever they are accessed for reading or writing, and Mac OS X keeps track of such things by having disk mounting and physical insertion/ejection controlled entirely by software, making the user's actions interdependent with the software's state. FreeBSD (and other x86 UNIXes) do not have the latter luxury or the former sophistication, so you must shoulder the burden of making sure the system's impression of its mounted disks is an accurate one. Most CD-ROM drives lock their trays when the operating system has a disk mounted because they have soft-eject mechanisms that are aware of the media's state in the operating system. Such a drive will not respond when you press the Eject button until you have unmounted the device. Floppies, however, can be mechanically ejected on a whim, and even CD-ROMs can be ejected through determination and the use of a paper clip. If a mounted device is ejected without being properly unmounted, and some program tries to read from or write to the device, the same kind of system destabilization can occur as described previously. The bottom line is this: Always remember to use umount /cdrom or umount /floppy before ejecting a disk. Your system will thank you. Other Removable MediaThe field of removable media is becoming more complex every day, with USB and FireWire-based external media and rewritable CD and DVD drives coming into the market at an ever-increasing pace. Zip drives and their relatives have been around for some time, and though they're beginning to disappear from the market, you might still have a use for them. FreeBSD supports parallel port Zip drives as the vp0 device and USB Zip drives as the umass device. But dozens of new devices are in development, and each will offer its own complications in writability, removability, and mountability. Your understanding of mounting and unmounting CD-ROMS and floppies, however, can help prepare you for dealing with other removable media devices in FreeBSD. |