fd(4)

๐Ÿ’พ fd(4) โ€” floppy disk device ๐Ÿ’พ

okay bestie, so this is fd from section 4 (kernel interfaces), and it's literally all about floppy disk devices. yes, the little plasticky square ones. we're going retro. ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

fd โ€” floppy disk device. that's it, that's the name, iconic.


โš™๏ธ CONFIGURATION โš™๏ธ

Floppy drives are block devices with major number 2. โœจ

Typically they're owned by root:floppy (so, user root, group floppy), and they've got either mode 0660 (access checking happens via group membership) or mode 0666 (literally everybody has access, the audacity ๐Ÿ’…).

The minor numbers are the ones doing the heavy lifting here โ€” they encode the device type, the drive number, and the controller number. no cap. For every device type (and "device type" means a combination of density and track count) there's a base minor number. Then to that base number you add the drive's number on its controller, plus 128 if that drive is on the secondary controller. math but make it floppy. ๐Ÿงฎ

In all the device tables below, n represents the drive number.

โš ๏ธ WARNING, and I need you to actually read this one: if you use formats with more tracks than your drive supports, you may cause it mechanical damage. Trying once, if more tracks than the usual 40/80 are supported, should not damage it โ€” but no warranty is given for that. If you're not sure, do not create device entries for those formats, so as to prevent their usage. protect your hardware, bestie, she's fragile ๐Ÿฅบ

๐Ÿฆ‹ Drive-independent device files ๐Ÿฆ‹

these ones automatically detect the media format and capacity. main character behavior fr:

Name    Base minor #
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
fdn       0

๐Ÿ’– 5.25 inch double-density device files ๐Ÿ’–

Name         Capacity   Cyl.   Sect.   Heads    Base
               KiB                             minor #
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
fdnd360        360       40      9       2        4

๐Ÿ”ฅ 5.25 inch high-density device files ๐Ÿ”ฅ

Name         Capacity   Cyl.   Sect.   Heads    Base
               KiB                             minor #
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
fdnh360        360       40      9       2       20
fdnh410        410       41     10       2       48
fdnh420        420       42     10       2       64
fdnh720        720       80      9       2       24
fdnh880        880       80     11       2       80
fdnh1200       1200      80     15       2        8
fdnh1440       1440      80     18       2       40
fdnh1476       1476      82     18       2       56
fdnh1494       1494      83     18       2       72
fdnh1600       1600      80     20       2       92

๐ŸŒˆ 3.5 inch double-density device files ๐ŸŒˆ

Name         Capacity   Cyl.   Sect.   Heads    Base
               KiB                             minor #
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
fdnu360        360       80      9       1       12
fdnu720        720       80      9       2       16
fdnu800        800       80     10       2       120
fdnu1040       1040      80     13       2       84
fdnu1120       1120      80     14       2       88

๐Ÿ’œ 3.5 inch high-density device files ๐Ÿ’œ

Name         Capacity   Cyl.   Sect.   Heads    Base
               KiB                             minor #
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
fdnu360        360       40      9       2       12
fdnu720        720       80      9       2       16
fdnu820        820       82     10       2       52
fdnu830        830       83     10       2       68
fdnu1440       1440      80     18       2       28
fdnu1600       1600      80     20       2       124
fdnu1680       1680      80     21       2       44
fdnu1722       1722      82     21       2       60
fdnu1743       1743      83     21       2       76
fdnu1760       1760      80     22       2       96
fdnu1840       1840      80     23       2       116
fdnu1920       1920      80     24       2       100

๐Ÿ‘‘ 3.5 inch extra-density device files ๐Ÿ‘‘

slay, look at that capacity:

Name         Capacity   Cyl.   Sect.   Heads    Base
               KiB                             minor #
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
fdnu2880       2880      80     36       2       32
fdnCompaQ      2880      80     36       2       36
fdnu3200       3200      80     40       2       104
fdnu3520       3520      80     44       2       108
fdnu3840       3840      80     48       2       112

โœจ DESCRIPTION โœจ

fd special files access the floppy disk drives in raw mode. and the following ioctl(2) calls are supported by fd devices. let's get into it:

  • FDCLRPRM โ€” clears the media information of a drive (aka the geometry of the disk in the drive). bye bye disk info ๐Ÿซถ
  • FDSETPRM โ€” sets the media information of a drive. heads up: the media information will be lost when the media is changed. it's giving temporary.
  • FDDEFPRM โ€” sets the media information of a drive (geometry of disk in drive), and this time the media information will not be lost when the media is changed. but plot twist: this disables autodetection. if you want autodetection back, you have to issue an FDCLRPRM. you gotta commit to the bit. ๐Ÿ”„
  • FDGETDRVTYP โ€” returns the type of a drive (the name parameter). for formats which work in several drive types, FDGETDRVTYP returns a name which is appropriate for the oldest drive type which supports this format. respect your elders. ๐Ÿ‘ต
  • FDFLUSH โ€” invalidates the buffer cache for the given drive. flush it, periodt. ๐Ÿšฝ
  • FDSETMAXERRS โ€” sets the error thresholds for reporting errors, aborting the operation, recalibrating, resetting, and reading sector by sector.
  • FDSETMAXERRS โ€” gets the current error thresholds. (yes, the manpage really does say FDSETMAXERRS here again. i'm just the messenger, bestie, i keep every detail exactly as it is ๐Ÿ˜ญ)
  • FDGETDRVTYP โ€” gets the internal name of the drive.
  • FDWERRORCLR โ€” clears the write error statistics. fresh start energy โœจ
  • FDWERRORGET โ€” reads the write error statistics. these include the total number of write errors, the location and disk of the first write error, and the location and disk of the last write error. disks are identified by a generation number which is incremented at (almost) each disk change. almost. ๐Ÿ™ˆ
  • FDTWADDLE โ€” switch the drive motor off for a few microseconds. this might be needed in order to access a disk whose sectors are too close together. small nap, big difference ๐Ÿ˜ด
  • FDSETDRVPRM โ€” sets various drive parameters.
  • FDGETDRVPRM โ€” reads these parameters back. reciprocity! ๐Ÿ’ž
  • FDGETDRVSTAT โ€” gets the cached drive state (disk changed, write protected et al.)
  • FDPOLLDRVSTAT โ€” polls the drive and return its state. (going to the source directly, love that for us)
  • FDGETFDCSTAT โ€” gets the floppy controller state.
  • FDRESET โ€” resets the floppy controller under certain conditions. certain conditions. mysterious. ๐ŸŒซ๏ธ
  • FDRAWCMD โ€” sends a raw command to the floppy controller. raw. unfiltered. no notes. ๐Ÿ”ฅ

For more precise information, consult also the <linux/fd.h> and <linux/fdreg.h> include files, as well as the floppycontrol(1) manual page. iykyk ๐Ÿ“š


๐Ÿ“ FILES ๐Ÿ“

  • /dev/fd*

๐Ÿ“ NOTES ๐Ÿ“

The various formats permit reading and writing many types of disks. however โ€” and this is a big however โ€” if a floppy is formatted with an inter-sector gap that is too small, performance may drop, to the point of needing a few seconds to access an entire track. a few seconds!! to access one (1) track!! to prevent this, use interleaved formats. consider yourself warned. ๐ŸŒ

It is not possible to read floppies which are formatted using GCR (group code recording), which is used by Apple II and Macintosh computers (the 800k disks). so those are just cute little bricks to us, unfortunately. ๐Ÿ’€

Reading floppies which are hard sectored (one hole per sector, with the index hole being a little skewed) is not supported. this used to be common with older 8-inch floppies. ancient history, bestie, we don't do that here. ๐Ÿ›๏ธ


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

chown(1), floppycontrol(1), getfdprm(1), mknod(1), superformat(1), mount(8), setfdprm(8)


and that's the whole page, bestie!! ๐Ÿ’– this was fd(4) from the Linux man-pages, version 6.20, dated 2026-02-08. go forth and format responsibly, don't give your drive more tracks than it can handle, and remember: no warranty is given for that. mwah ๐Ÿซถโœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from
  • arch rolling: man-pages 6.20-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • ๐Ÿ“œ the page's license: GPL-2.0-or-later
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms