The FreeBSD Corporate Networker's Guide
Working with floppies
Why use floppies when the network is there?
With floppies, like other media, formatting is divided into low-level formatting and high-level formatting. It is particularly critical to low-level format floppies because often floppy media can develop bad spots. This is not a problem under DOS or Windows because the File Allocation Table (FAT) that those operating systems put onto the floppy media will mark off bad sectors. However, under UNIX, there is no mechanism for dealing with bad sectors. In general, UNIX assumes that media are inherently perfect, and it is up to the electronics on the media to make bad sectors transparent. Hard disks can do this, but floppies can't, so they must be low-level formatted to ensure perfect media.
UNIX high-level formatting is a bit different. A floppy can be high-level formatted as a UNIX File System (UFS) format, or a MS-DOS format, or it can have no format and be treated as a raw media device like a tape is. What you do depends on what application you need to use. The tar, dd, and cpio programs don't require that the floppy media be formatted. MS-DOS format is required if the floppy is to be used in DOS or Windows systems. UFS format is required if the floppy is to be mounted in other UNIX systems. I'll assume that you know how to format a floppy with DOS or Windows and just cover dd, tar and UFS here.
For all applications, the first thing to do is to low-level format the floppy. To low-level format a 1.4MB floppy in the A: drive type:
fdformat -f 1440 /dev/rfd0
The output should be a row of V's like this:
If there are any Es (errors) in there, don't use the floppy under UNIX. After that, it's ready for use by another application.
dd is used with floppies for copying image files. For example, creating an installation floppy from a new FreeBSD CD mounted in the CD drive could be done like this:
dd if=/cdrom/floppies/boot.flp of=/dev/fd0
tar is used for making floppies that are readable between different UNIX versions, For example, to copy a file named "test.txt" you might do the following:
tar cf /dev/fd0 test.txt
To get the file off the floppy you would do
tar xf /dev/fd0
UFS is used to copy files between UNIX systems. There is a 2-step process for this with floppies:
To format a 1.4MB floppy in the A: drive with UFS, do the following:
disklabel -r -w /dev/rfd0 fd1440
To mount it onto the /fd directory, do this:
mount /dev/fd0c /fd
Copying files to /fd will copy them onto the floppy, and copying files from the /fd directory will copy them off of the floppy.
To unmount the floppy, type:
© Copyright 2000-2003 Ted Mittelstaedt. All rights reserved.