# Floppy support?

## eccerr0r

Anyone using their floppy drive anymore?

I wonder how much bit rot happened here.  I was trying to test my Epson SD800 dual drive and couldn't read a single sector.  Unfortunately I don't know if it's the drive or the driver...

Seems sys-apps/util-linux requries USE=fdformat to get the low level formatter program for Linux.

----------

## xaviermiller

Hi!

I still use it (for synthesizers). I have a lot of defective diskettes, but when it works, I can access them with mtools.

----------

## NeddySeagoon

eccerr0r,

I have all the bits and pieces to test both 5 1/4" and 3 1/2" floppies, except for the 2.88Mb format.

I did read a set of Windows 3.1 and DOS 6.2 disks a while ago, so reading 3 1/2" floppies worked then.

I also have all the old fashioned /dev nodes to format floppies. Remember those ?

```
$ ls /dev/fd0*

/dev/fd0        /dev/fd0d360   /dev/fd0h410   /dev/fd0u1660  /dev/fd0u2880  /dev/fd0u820

/dev/fd0CompaQ  /dev/fd0h1200  /dev/fd0h420   /dev/fd0u1680  /dev/fd0u3200  /dev/fd0u830

/dev/fd0D360    /dev/fd0h1440  /dev/fd0h720   /dev/fd0u1722  /dev/fd0u3520

/dev/fd0D720    /dev/fd0h1476  /dev/fd0h880   /dev/fd0u1743  /dev/fd0u360

/dev/fd0H1440   /dev/fd0h1494  /dev/fd0u1040  /dev/fd0u1760  /dev/fd0u3840

/dev/fd0H360    /dev/fd0h1660  /dev/fd0u1120  /dev/fd0u1840  /dev/fd0u720

/dev/fd0H720    /dev/fd0h360   /dev/fd0u1440  /dev/fd0u1920  /dev/fd0u800
```

----------

## Irre

I scanned over 100 diskettes yesterday looking for a program I wrote 20 years ago. I didn't find it, today I threw them away. I only kept a boot-disk for my old pentium pc.   :Very Happy: 

----------

## eccerr0r

Oh yeah... I remember all those fd0XCCCC entries in /dev.  When I modprobed floppy, I don't see them, was wondering if udev supported them anymore or simply an ioctl is needed to specify the format.  Do all those fd0XCCCC entries still connect to the kernel?

The only known working floppy drive I have now is a 3.5" USB unit.  I'm sure that one will continue to be "supported" for a while as it uses a different driver that will likely be maintained for a while (usb_storage).

When I tried accessing the Epson SD800 floppy drive (half height 5.25" bay with both 5.25 and 3.5 drives) I got a whole bunch of diagnostic information in dmesg, which is why I wonder if the kernel is still working.  This machine still uses ISA and has a dual drive floppy controller (I wish the Linux kernel didn't drop all the ISA drivers...) and hence I'm using kernel 3.4.110 - updating would mean the Ethernet controller becomes unusable, so I couldn't test any newer kernels.

I initially tried on a old P4 motherboard but that board was worse, it had only a single floppy drive controller...

----------

## NeddySeagoon

eccerr0r,

A single floppy controller actually supports four drives.

It was a DOS thing that made the first hard drive be C:\ because PCs commonly had two floppies.

I can see a 3 1/2" floppy from where I'm sitting, its on top of a real 'wireless', with valves that glow red when its on.

I'll need to dig out a cable for it so I can test.  ... the cable was down the back of the wireless.

I'll plug it in and play tomorrow.

----------

## eccerr0r

Most PC floppy controllers do not have all the drive selects wired out.  If they aren't wired out, then it can't control the extra drives on the 'bus'.  I think the P4 that I have only has one DS wired out, plus there's no support in setting more than one drive.

It's been a long time since I've seen a PC floppy controller that could actually support more than 2 drives, then again the floppy tapes may be addressed this way perhaps? 

Now that's a driver that was deprecated and removed... anyone has one of those QIC40/80 DC2080/2120/etc. floppy tape drives and have it still work in Linux?

----------

## lindegur

I had to read some old floppies. 

Good news it worked.  :Laughing:   It however looks that floppy support is disappearing from the standard configurations.   :Rolling Eyes: 

After having a kernel with the floppy kernel module I just got a /dev/fd0 file that I could use to mount and read the floppies.

Files as /dev/fd0u1440 did no more appear.   :Rolling Eyes: 

To format the floppy fdformat was missing but could be added by setting the useflag fdformat.

mkfs.ext2 /dev/fd0 created a floppy with ext2 that could be mounted and written.

To format a fat floppy I could no more find the mkdosfs command on my computer.

It seemed to have disappeared from the dosfstools package.   :Rolling Eyes: 

mkfs.vfat /dev/fd0 did the same job I guess.  :Laughing: 

Now it is time to remove the floppy drive from my computer and close the case.  :Cool: 

----------

## The_Great_Sephiroth

I used dd to make images of all of my floppies years ago. Used checksums to verify them. Now they're on BTRFS.

----------

## krinn

 *eccerr0r wrote:*   

> Anyone using their floppy drive anymore?

 

i still have a 31/2 somewhere that i didn't bin (in case of), now i think it is too well hidden under all over "in case of" parts i have that i couldn't find it.

----------

## John R. Graham

Had to do a firmware upgrade just last week for an older Adaptec RAID controller where its BIOS wanted to read the firmware directly from floppy disk. I still had the drives, cables, and sundries in my parts bin but it was a little bit of a pain to get all the pieces together. There was no trouble at all writing the firmware files to the floppy disk from Linux, though.

- John

----------

## Roman_Gruber

My newly purchased second hand USB floppy drive (smaller floppies aroudn 486 onwards) does work in gentoo. i only have one floppy left with some software for my evaluation board, because i trashed the others age ago.

Instantly got output in dmesg, I could mount it instantly, no issues

--

my POWERRAM usb stick, has an emulated floppy drive, does also works for years with my gentoo. This usb stick has two "partitions", one floppy one, one ordinary one.

----------

## Ciff

Hi! : )

Just for the records, as this is quite an old thread..

I found linux in general to be VERY helpful in cloning and maintaining floppies' surface, also for forensics!

Default scenario:

You are looking for something, and whilst searching, you find a set of old floppy disks, hidden somewhere behind some books or old games in the shelf.

The following steps are very likely to happen (for me)..

1) turn on the old Athlon machine, that still has 3,5" floppy support and boot up gentoo, that is installed (and maintained) there still since ages.

2) put in the floppy disk and mount this thingy --> you can hear if there are any read problems

3) look what's on there..

3.1) and if it is helpful.. make a floppy image or rescue the important parts using the steps shown later

3.2) if it's not helpful, erase the disk and see if it still works (no bad sectors etc) shown later.

4) mount a target via cifs and store the thingy on a centralised and backed-up machine in the network

5) umount

So.. now.. which steps to take to create a floppy image from something important saved on such a thingy?

1) boot up gentoo

2) mount the target where to store the image (like for instance via mount.cifs)

3) dd if=/dev/fd0 of=/mnt/target/w00t.img

3.1) in case there are read errors and the image cannot be completed, I mount the floppy and try to extract the important files, in the hope they are still intact, and save them to /mnt/target

4) umount

Last but not least.. how to erase, check and maintain the floppy disk surface with non-needed disks, for instance to store them, knowing they DO work next time you need them..

1) boot up gentoo

2) dd if=/dev/zero of=/dev/fd0 <-- overwrites the surface bit-wise; you can hear, if there are any write issues with either the drive or the floppy itself

3) mkfs.msdos /dev/fd0 <-- create whatever file system you need

4) mount /dev/fd0 /mnt/fd0 <-- mount the floppy to see if everything worked out. Again: You can hear the drive raging xD if some bit cannot be read properly. If so... not good. - Try again from step 1 OR give this floppy up if you have tried several times and it is not getting any better

5) cat /dev/zero > /mnt/fd0/testfile <-- write zeros in a file called "testfile" on the floppy, filling up every last bit of it

6) umount /mnt/fd0 <-- if this works out without write problems, the disk is fine and can be used next time you need it. If you can hear the drive has trouble writing, try again from step 1. If it is not getting better at the 3rd try, discard the floppy.

Working for me for 5,25" floppies and 3,5" ones of all kinds.

I'm very pleased with this way to maintain floppies. If you have commens or suggestions, please let me know. ( :

----------

## fturco

I would use ddrescue instead of dd for ripping floppy disks and badblocks for wiping them.

----------

## NeddySeagoon

Ciff,

 *Ciff wrote:*   

> 2) dd if=/dev/zero of=/dev/fd0 <-- overwrites the surface bit-wise; you can hear, if there are any write issues with either the drive or the floppy itself
> 
> 3) mkfs.msdos /dev/fd0 <-- create whatever file system you need 

 

After the floppy has been wiped, don't you need to format it before you can make a filesystem?

A long time ago linux had  

```
$ ls /dev/fd0*

/dev/fd0        /dev/fd0D720   /dev/fd0h1476  /dev/fd0H360  /dev/fd0H720   /dev/fd0u1440  /dev/fd0u1743  /dev/fd0u2880  /dev/fd0u3840  /dev/fd0u830

/dev/fd0CompaQ  /dev/fd0h1200  /dev/fd0h1494  /dev/fd0h410  /dev/fd0h880   /dev/fd0u1660  /dev/fd0u1760  /dev/fd0u3200  /dev/fd0u720

/dev/fd0d360    /dev/fd0h1440  /dev/fd0h1660  /dev/fd0h420  /dev/fd0u1040  /dev/fd0u1680  /dev/fd0u1840  /dev/fd0u3520  /dev/fd0u800

/dev/fd0D360    /dev/fd0H1440  /dev/fd0h360   /dev/fd0h720  /dev/fd0u1120  /dev/fd0u1722  /dev/fd0u1920  /dev/fd0u360   /dev/fd0u820
```

to be able to write all sorts of strange formats on a floppy before the filesystem was made.

Maybe 

```
mkfs.msdos /dev/fd0
```

 formats the floppy too?

Its been a long time since I've needed to use a new floppy in Linux.

----------

## Ciff

@fturco: hehe ddrescue is a good idea, aslong as the boot media has such a neat thing. : )

@NeddySeagoon: Mhmhmm.. always worked out nice for me. Looks like mkfs.msdos does kind of a quick format?! Or.. it just works unformatted, which is weird but hey.. as long as every machine accepts the media... : )

Cewl thing is, this works for every media size, while it needs no other commands but these. - Tried this out with 720 kb and 1,445 MB floppies.

----------

## Fitzcarraldo

Back in 2004 I bought an external USB floppy disk drive to use with a laptop running Windows XP to read some old 3.5" floppy disks. The label on the drive gives the manufacturer and model as 'SmartDisk: FDUSB-TM2, Mitsumi Model #: D353FUE'.

Anyway, in January this year I wanted to throw out several boxes of 720KB DD (Double Density) and 1440KB HD (High Density) 3.5" floppy disks but first needed to check their contents and wipe them. So I dug out the above-mentioned SmartDisk USB drive to see if it would work with the current Gentoo Linux installation on my current laptop. I was pleased to discover that it does, and below are some notes on how to use it in case anyone else needs to use one of these devices.

Once plugged in to a USB port on my laptop, the lsusb command shows the device has been recognised:

```
Bus 001 Device 013: ID 03ee:6901 Mitsumi SmartDisk FDD
```

Note that the Linux floppy driver is not needed for USB floppy disk drives:

```
# grep -i CONFIG_BLK_DEV_FD /usr/src/linux/.config

# CONFIG_BLK_DEV_FD is not set
```

A Linux utility named ufiformat is used to low-level format floppy disks in USB floppy disk drives. A Gentoo Linux ebuild for Version 0.9.9 of ufiformat is listed below, and it can be used in a local overlay under the category sys-fs:

```
# Copyright 1999-2014 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

 

EAPI=5

 

DESCRIPTION="USB Floppy Disk formatting tool"

HOMEPAGE="http://www.geocities.jp/tedi_world/format_usbfdd_e.html"

SRC_URI="http://www.geocities.jp/tedi_world/${P}.tar.gz"

 

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="~amd64 ~x86"

IUSE=""

 

RDEPEND="sys-fs/e2fsprogs"

DEPEND=${RDEPEND}
```

The ufiformat utility is straightforward to use:

```
# ufiformat --help

Usage: ufiformat [OPTION]... [DEVICE]

Format a floppy disk in a USB floppy disk DEVICE.

  -f, --format [SIZE]  specify format capacity SIZE in KB

                       without -f option, the format of the current media will be used

  -V, --verify         verify the medium after formatting

  -F, --force          do not perform any safety checks

  -i, --inquire        show device information, instead of performing format

                       without DEVICE argument, list USB floppy disk devices

  -v, --verbose        show detailed output

  -q, --quiet          suppress minor output

  -h, --help           show this message
```

To find the device name, use the blkid command before plugging in the USB cable and again after plugging in the USB cable. The extra device listed the second time will be the floppy disk drive. For example, in my case the new line at the end of the blkid output indicated the drive was /dev/sdd:

```
/dev/sdd: SEC_TYPE="msdos" UUID="BBBA-37AF" TYPE="vfat"
```

The fdisk command will confirm that the device is the floppy drive:

```
# fdisk -l /dev/sdd

Disk /dev/sdd: 720 KiB, 737280 bytes, 1440 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x00000000
```

Note that /dev/sdd will not be listed in the output of blkid if there is no disk in the floppy drive, although the ls command will list /dev/sdd while the drive is connected to the computer.

Notice that there are no devices /dev/fd0, /dev/fd1, /dev/fd2 and /dev/fd3, etc. This does not matter.

```
# ls /dev

audio1           dri      i2c-10   kmem          mapper              nvidiactl  sda1       sequencer2  tty0   tty2   tty30  tty41  tty52  tty63    usbmon3     vcs2    vcsa12

autofs           dsp1     i2c-11   kmsg          mcelog              nvram      sda2       sg0         tty1   tty20  tty31  tty42  tty53  tty7     usbmon4     vcs3    vcsa2

block            fb0      i2c-2    log           mem                 pktcdvd    sda3       sg1         tty10  tty21  tty32  tty43  tty54  tty8     v4l         vcs4    vcsa3

bsg              fd       i2c-3    loop-control  memory_bandwidth    port       sda5       sg2         tty11  tty22  tty33  tty44  tty55  tty9     vboxdrv     vcs5    vcsa4

bus              full     i2c-4    loop0         mixer               ptmx       sda6       sg3         tty12  tty23  tty34  tty45  tty56  ttyS0    vboxdrvu    vcs6    vcsa5

char             fuse     i2c-5    loop1         mixer1              pts        sda7       shm         tty13  tty24  tty35  tty46  tty57  ttyS1    vboxnetctl  vcs7    vcsa6

console          hidraw0  i2c-6    loop2         mqueue              random     sdb        snapshot    tty14  tty25  tty36  tty47  tty58  ttyS2    vboxusb     vcs8    vcsa7

core             hidraw1  i2c-7    loop3         network_latency     rfkill     sdb1       snd         tty15  tty26  tty37  tty48  tty59  ttyS3    vcs         vcs9    vcsa8

cpu              hidraw2  i2c-8    loop4         network_throughput  root       sdc        stderr      tty16  tty27  tty38  tty49  tty6   urandom  vcs1        vcsa    vcsa9

cpu_dma_latency  hpet     i2c-9    loop5         null                rtc        sdc1       stdin       tty17  tty28  tty39  tty5   tty60  usbmon0  vcs10       vcsa1   vga_arbiter

cuse             i2c-0    initctl  loop6         nvidia-modeset      rtc0       sdd        stdout      tty18  tty29  tty4   tty50  tty61  usbmon1  vcs11       vcsa10  video0

disk             i2c-1    input    loop7         nvidia0             sda        sequencer  tty         tty19  tty3   tty40  tty51  tty62  usbmon2  vcs12       vcsa11  zero

# ls -la /dev/fd

lrwxrwxrwx 1 root root 13 Jan 17 02:13 /dev/fd -> /proc/self/fd

# ls -la /proc/self/fd

total 0

dr-x------ 2 root root  0 Jan 17 04:26 .

dr-xr-xr-x 8 root root  0 Jan 17 04:26 ..

lrwx------ 1 root root 64 Jan 17 04:26 0 -> /dev/pts/1

lrwx------ 1 root root 64 Jan 17 04:26 1 -> /dev/pts/1

lrwx------ 1 root root 64 Jan 17 04:26 2 -> /dev/pts/1

lr-x------ 1 root root 64 Jan 17 04:26 3 -> /proc/17669/fd
```

To format an HD floppy disk with the FAT file system, I did the following:

```
# ufiformat -f 1440 /dev/sdd

geometry: track=80, head=2, sector=18, block=512

done

# /usr/sbin/mkfs.vfat /dev/sdd

mkfs.fat 4.0 (2016-05-06)

attribute "partition" not found

# ufiformat -i /dev/sdd

vendor:  MITSUMI

product: USB FDD

write protect: off

media type: 2HD

status      block size   kb

formatted    2880  512 1440

formattable  2880  512 1440

formattable  1232 1024 1232

formattable  2400  512 1200
```

To format a DD floppy disk with the FAT file system, I did the following:

```
# ufiformat -f 720 /dev/sdd

geometry: track=80, head=2, sector=9, block=512

done

# /usr/sbin/mkfs.vfat /dev/sdd

mkfs.fat 4.0 (2016-05-06)

attribute "partition" not found

# ufiformat -i /dev/sdd

vendor:  MITSUMI

product: USB FDD

write protect: off

media type: 2DD

status      block size   kb

formatted    1440  512  720

formattable  1440  512  720
```

I use the KDE Desktop Environment. The Device Notifier widget in the System Tray shows the drive and — once a formatted floppy disk is in the drive — it is possible to use the Device Notifier to mount, open and unmount the floppy disk. However, it is also possible to use the command line:

```
# mkdir /mnt/floppy

# mount /dev/sdd /mnt/floppy

# ls /mnt/floppy

# cp /test.txt /mnt/floppy/

# ls /mnt/floppy

test.txt

# umount /dev/sdd
```

Earlier in this post I showed examples of formatting floppy disks using the FAT file system, but it is of course possible to format them using other file systems, such as:

```
# mkfs.ext2 /dev/sdd

mke2fs 1.43.3 (04-Sep-2016)

/dev/sdd contains a vfat file system

Proceed anyway? (y,n) y

Creating filesystem with 720 1k blocks and 96 inodes

Allocating group tables: done

Writing inode tables: done

Writing superblocks and filesystem accounting information: done
```

Anyway, I was able to check the contents of the floppies and wipe them before disposing of them.

----------

## Ciff

@Fitzcarraldo: Very interesing, that ufiformat tool!

But why is this all necessary, if it also works without? oo*

Havn't faced any hardships. The disks get recognised on DOS 5.0 up to 6.22 and also OS/2 Warp 3, Windows 7, etc.

I suppose ufiformat is THE way to go, but weird that it also works without formatting at all. @_@

I know it does not work without mkfs.msdos though in my tests.

Btw.. using vfat is afaik not the same as msdos. vfat should be the "new" fat32 format. Not sure if this is compatible to older operating systems, used to fat16.

----------

## Fitzcarraldo

All my floppy disks were already formatted and readable. I used the ufiformat tool to low-level format them so that no one would be able to read them after I disposed of them. Simple as that.

 *man mkfs.vfat wrote:*   

> -F FAT-size
> 
>     Specifies the type of file allocation tables used (12, 16 or 32 bit). If nothing is specified, mkdosfs will automatically select between 12, 16 and 32 bit, whatever fits better for the file system size.

 

----------

## John R. Graham

 *NeddySeagoon wrote:*   

> After the floppy has been wiped, don't you need to format it before you can make a filesystem?

 Not at all. All the dd command does is write zeroes to all of the already formatted sectors. Such a write does not disturb the formatting in any way.

- John

----------

## NeddySeagoon

John R. Graham,

Ahh of course.  I learned about floppies from an APPLE ][.

Its all is the software there.  The PC is so much easier.

----------

## eccerr0r

Forgot about this thread...

(1) Ugh...Apple Disk ][ is like evil.  No rules, except physics.  Nice to have a drive that didn't need the sector hole sometimes, though it wasn't the only one I've seen (Atari 810/1050 was the other that I recall.)  Granted at ~135K/90K/127K per side it leaves much to be desired.

(2) Oh those USB floppy drives, you spoiled brats ... cooked SCSI interface, must be nice... (then again I recall having trouble with 720K disks on mine?)

Will need to look for ufiformat if it still exists.  Was looking for some formatting utility that would actually work on these USB drives.

Also forgot, was FAT12 used on 3½" disks?  I recall FAT12 on 5¼ DD disks to save space, but possible even 3½HD disks too...

----------

## NeddySeagoon

eccerr0r,

USB Floppy interfaces are mostly evil.

They only support a single data rate and the data rate out of a floppy drive varies with the drive size and format.

Early Apple 3 1/2" drives even did zoning, so the data rate differed for different track.

The upshot is that if you want to access 3 1/2" 1.44MB floppies, you are good. Anything else, forget it.

FAT16 was not invented in the days of 5 1/4" floppies.

----------

## eccerr0r

Looks like floppy disks all default to FAT12 to save wasted space on FAT though FAT16 was available during the time of the 1.44M disk.

I'm also surprised Apple 3½" disks were ZBR but still only had the same nominal capacity of 3½" HD disks.  I recall it possible to get up to 1.7MB on these 3½" HD disks with nonstandard format on a regular PC controller, so the media itself supported higher than stated density.  Coupled with ZBR it should hold more than standard PC disks.

----------

## NeddySeagoon

eccerr0r,

If you use bigger sectors per track, a PC floppy holds 1.7MB of user data. You get user data in the missing sector headers/trailers.

----------

## The_Great_Sephiroth

I have about thirty floppy drives (3.25") in my parts closet. If anybody needs one...

I have some 5.25" drives as well, but I am hoarding those. They're from my childhood.

----------

## eccerr0r

do they have Linux support?  :Very Happy: 

What 5¼" drives? Shugarts?  1.2M Teacs?

I don't think I have any more 8" drives anymore.  The disks were never reliable and expensive, to boot... if they boot...

----------

## figueroa

About half of my Gentoo machines still have floppy drives. My main/older development box has a combo 1.44/1.2 drive, a Teac, I think, and I have a spare or two. It's been a couple of years since I've used the drives to read anything, but I've kept support configured in the kernel.

----------

## eccerr0r

Too bad floppy tape support's gone :(

Not that a whole whopping 120MB is much storage...

I think I've ever only come across one double 1.2/1.44 drive.  It's made by Epson IIRC.  Other than the novelty of having used one HH 5¼" bay, not sure if there's anything really special about this drive.  I don't think I've ever had this drive work though since I haven't figured out the jumpers not to mention my boards with working and full floppy support is dwindling.  I have one board with a half- or ¾- (since the floppy port normally controlls up to 4 drives) neutered floppy port that can control only one drive.

----------

