This is brief overview of floppy disk management in linux, with a specific view to Fedora Core.
1. Floppy devices
Most linux systems including Fedora Core provide floppy device access through the /dev/fd* devices files. Symlinks are traditionally created by the device mangement part of the kernel like /dev/floppy, which might point to /dev/fd0, the first floppy device.
A. The /dev Devices
Subsequent floppy device are then made available as /dev/fd1, /dev/fd2 and etc. Assuming that a floppy is made available through /dev/fd0, then it may be accessed (or formatted) at different capacities by using the following devices:
/dev/fd0 3.5 inch standard double-sided, high-density 1440KB (1.44MB) /dev/fd0u1440 same as fd0 /dev/fd0u1680 3.5 inch 1440KB DS-HD floppy with extra track (reliable) /dev/fd0u1760 3.5 inch 1440KB DS-HD floppy with 2 extra tracks (reliable) /dev/fd0u360 5.25 inch 360KB Single Sided High Density floppy /dev/fd0u720 5.25 inch 360KB Double Sided High Density floppy
Other non-standard sizes, haven't testsed these:
/dev/fd0u800 /dev/fd0u820 /dev/fd0u830 /dev/fd0u1040 /dev/fd0u1120 /dev/fd0u1722 /dev/fd0u1743 /dev/fd0u1840 /dev/fd0u1920
B. Device detection
Check dmesg(1) or /var/log/messages for the Floppy Device. An entry in the logs should appear if the device is detected properly and attached to a device handler. E.g.,
bash # cat /var/log/messages|egrep -i 'floppy|fd.*[0-9]' May 8 15:17:27 howzat kernel: ide-floppy driver 0.99.newide May 8 15:17:28 howzat kernel: Floppy drive(s): fd0 is 1.44M May 8 15:17:28 howzat kernel: FDC 0 is a post-1991 82077
Another way of determining if a floppy drive is properly detected by the kernel is to use the probe feature of the floppy(1) utility:
bash $ floppy --probe floppy 0.12 Copyright 2001, Double Precision, Inc. floppy /dev/fd0: 3.5" HD
2. The floppy utility
Linux comes with floppy(1), a utility for managing floppy devices. The floppy(1) command is capable of formatting, verifying and describing capacities of floppies.
Floppy(1) uses low-level formatting calls to format floppies and because of this the exact geometry of the disk must be specified (with the --size option). Floppy(1) is able to print the capacity geometries for any floppy device that it finds. However, to do this it must first be configured.
By default, floppy(1) uses the configuration file /etc/floppy. To create this file, use the --createrc option as follows:
bash # floppy --createrc > /etc/floppy
3. Formatting
Formatting a floppy at the standard size (1440 MB) is pretty easy. Linux provides access to a large variety of formatable floppy devices, such as single sided, double-sided, extra track (1680KB, 1740KB).
The linux floppy(1) utility can be used to perform low-level floppy disk formatting. The floppy(1) tool uses a simple interface for formatting disks in floppy controller drives and in ATAPI IDE floppy drives, such as LS-120 "Superdisk" drives. ATAPI IDE support requires a patch to the Linux kernel. Without a patched kernel floppy can only format disks in floppy controller drives.
A. Standard double-sided high-density 1440KB
Using floppy(1), a 1.44MB 3.5" disk can be formatted with ease. To format a 3.5", first determine what capacities are available with:
After the format completes, check the capacity, with:
$ floppy --capacity A: floppy 0.12 Copyright 2001, Double Precision, Inc. Formattable capacities for /dev/fd0: 80x36x512 (/dev/fd0H1440, 1.40 Mb) 80x18x512 (/dev/fd0D720, 720 Kb) 80x48x512 (/dev/fd0u1920, 1.87 Mb) 80x28x512 (/dev/fd0u1120, 1.09 Mb) 80x40x512 (/dev/fd0u1660, 1.56 Mb) 80x26x512 (/dev/fd0u1040, 1.01 Mb) 80x46x512 (/dev/fd0u1840, 1.79 Mb) 80x42x512 (/dev/fd0u1680, 1.64 Mb)
Then format the floppy to the desired capacity by specifying the geometry with the --size option. E.g., to format a 3.5" floppy to standard 1.44MB capacity with FAT32 filesystem:
3.5" at 1.44MB (FAT32)
bash $ floppy --format --size=80x36x512 --fat --verify /dev/fd0
3.5" at 1.68MB (FAT32)
bash $ floppy --format --size=80x42x512 --fat --verify /dev/fd0
B. Formatting for higher capacity
Linux provides higher capacity device access through alternate /dev devices for each floppy disk installed in the current environment. For example the first floppy at /dev/fd0 as alternate devices /dev/fd0u1680 and etc, the second /dev/fd1u1680 and so on. There are a hugh array of different capacity devices for floppies (see #1). See #2 (configuration) and #3.A (capacity) above for determining device geometries.
To format a 3.5" at 1680K (1.68MB) with an ext2 filesystem
bash $ floppy --format --size="80x42x512" --ext2 --verify /dev/fd0
The floppy(1) output should be something like:
floppy 0.12 Copyright 2001, Double Precision, Inc. Formatting 1.64 Mb... 100%
Note that if /etc/floppy is configured, then the floppy device can be specified by either its linux dev path, as in /dev/fd0, or by is dos drive letter like A: so that specifying /dev/fd0 or A: as the floppy device are equivalent
C. Other formatting techniques
See also:
* superformat
* fdformat
* dd
4. ISO and binary images
A binary image (*.bin) or ISO 9660 bootable image (*.iso) can be written to a floppy with the dd(1) command. Before writing the disk image, be sure that the floppy being written to is not write-protected and is properly formatted (to the same capacity as the disk image). See the section #3 on formatting.
For example, to write a 1680K disk image to a FA32 formatted floppy:
bash # floppy --format --size="80x42x512" /dev/fd0 bash # dd if=/tmp/Bering-uClibc_x.x_img_bering-uclibc-1680.bin of=/dev/fd0u1680