10

There's a bunch of usb floppy drives out there but it's clear they're quite limited. I want the ability to low level format my disks. Is there any usb/pci/anything adapter that can interface with these disks at that level?

Obviously I can just use an old computer, but I want to do this with my modern computer.

Something I've been investigating is usb->parallel->floppy but I'm not sure that'll do what I want.

And I know there's specialized hardware out there that can read and write these disks by themselves, or with special software, but I want something that can be used by, for instance, the fdformat command on linux. Something that the OS recognizes as a floppy drive.

Daffy
  • 201
  • 2
  • 4
  • Since you include PCI in your question: PCI (not PCIe) floppy controllers do exist, but are pretty hard to find. You might find this thread interesting: https://www.eevblog.com/forum/vintage-computing/latest-(most-modern)-motherboard-with-floppy-controller/ – Michael Graf Oct 24 '22 at 06:57
  • @MichaelGraf do you know of any PCI controllers apart from the Catweasel? – Stephen Kitt Oct 24 '22 at 07:21
  • 1
    The answers to the question linked above don’t satisfy the last paragraph in the question — Greaseweazle etc. don’t produce anything usable with fdformat & co. – Stephen Kitt Oct 24 '22 at 07:52
  • 2
    @StephenKitt fdformat would require OS drivers that make the hardware available as a floppy block device, and to my knowledge these only exist for hardware on old-computers. So if that is the most important point of the question, the answer is "you need to write linux drivers for the hardware supported on modern computers". So then it's not about "which hardware", but "find someone with the skills to write a driver". – dirkt Oct 24 '22 at 11:50
  • @dirkt yes, and it would be easier to use the existing user-space tools instead. – Stephen Kitt Oct 24 '22 at 12:03
  • Until my USB floppy quit working, I was able to issue fdformat commands with nonstandard sectors per track. I don't see the problem. – Joshua Oct 24 '22 at 14:46
  • @Joshua are you sure? I’ve just tried it, and it fails with “fdformat: could not determine current format type: Invalid argument”. The fdformat man page explicitly says “This utility does not handle USB floppy disk drives. Use ufiformat(8) instead.” fdformat relies on ioctls which aren’t supported by the USB floppy driver. – Stephen Kitt Oct 24 '22 at 15:21
  • @StephenKitt: Yes, I'm absolutely sure. I wonder if I had a completely different drive than some others because it used the standard floppy disk major and minor numbers despite being USB. – Joshua Oct 24 '22 at 16:25
  • @Joshua that’s interesting. Do you happen to remember what model of USB floppy you had, or perhaps what kernel module it used? Presumably the floppy driver if it had the same major/minor... I’ve never heard of a USB floppy that could be driven by the floppy driver, I’d love to know more about it. (“Standard” USB floppy drives show up as SCSI devices, e.g. /dev/sdd on my system right now, and not as any of the /dev/fd… devices.) – Stephen Kitt Oct 24 '22 at 16:27
  • @StephenKitt: TEAC-FD05PUB ; unfortunately no kernel module. Everything but the wifi driver is built into kernel. – Joshua Oct 24 '22 at 23:57
  • @StephenKitt: Right now it shows up as a SCSI floppy disk, but I'm certain that wasn't the case in 2004. I know I used that drive to superformat a floppy, copy a kernel and initrd to it, run lilo to make it bootable, then used it to install Linux on another machine for someone else that couldn't boot from CD. The boot image wouldn't have fit without superformatting it. – Joshua Oct 25 '22 at 00:05

2 Answers2

12

According to ArchWiki, the ufiformat tool can command those cheap USB floppy drives to perform a low-level format.

Aside from that, while I can't vouch for it myself, since I've only ever used mine to read floppies, archival/forensic USB floppy controllers like the KryoFlux, Greaseweazle, FluxEngine, etc. should be physically capable of it (they do deal in raw flux) and it's just a matter of software support.

The FluxEngine software recently gained filesystem support and supports Greaseweazle hardware too, so its new fluxengine format command may do what you want.

Alternatively, you could see if something like gw erase followed by writing an image of an empty disk would do what you want. (The help for KryoFlux's dtc CLI also lists a -we=2 option to set an erase mode of "wipe" when writing which may have a similar effect to gw erase followed by writing such an empty disk image.)

Both the FluxEngine and Greaseweazle can be had quite cheaply as far as such boards go (you'll still need a floppy drive, possibly cabling, and possibly an external power supply, depending on the board and whether you buy a bundle)... though the FluxEngine is a DIY "solder a connector or some pin header onto an FPGA dev board and flash it using Windows software" project and the dev board is suffering from the chip shortage. There's a Purchase a Greaseweazle page on the GitHub project's wiki and I managed to get a bare Greaseweazle V4, delivered, for about $36 Canadian.

I haven't had trouble finding "tested working" used 3.5" floppy drives on eBay to plug into my KryoFlux and Greaseweazle for under $30 Canadian including shipping from Europe.

ssokolow
  • 6,746
  • 2
  • 25
  • 40
  • ufiformat works fine and could well be a simple answer to this. – Stephen Kitt Oct 24 '22 at 07:52
  • ufiformat is limited to very short list of formats supported by the USB floppy drive controller (generally only HD 1440/1232/1200 and DD 720/640, always 512 bytes per sector), which limits sound to me as if they're the real problem he's trying to get around here. – cjs Oct 24 '22 at 17:08
5

The older USB floppy drives are real block/track devices. The new ones seem to have a hard-coded idea of the 1.44MB format, and can't low-level format disks.

Look for an external USB drive that says it has 720KB compatibility, such as the New--Professional Quality ones from floppydisk.com.

Neither of these devices can read/write more esoteric formats such as Apple 800KB, though.

scruss
  • 21,585
  • 1
  • 45
  • 113
  • 1
    Even 720K-compatible USB drives only support a limited set of formats, as defined in the USB spec. – Stephen Kitt Oct 25 '22 at 06:31
  • Yes, and I alluded to that: Mac, Apple II and Amiga are right out. But the most recent USB floppy drives are even less flexible – scruss Oct 25 '22 at 22:23
  • Ah, I thought you meant more than that by “real block/track devices”. – Stephen Kitt Oct 27 '22 at 16:13
  • 2
    oh, they are, in that you can access heads/sectors/tracks in the traditional way. You've got a fair chance of being able to read and create something like an Atari ST disk with extra sectors per track. The modern cheap USB floppy drives do nothing of the sort: at best you can read/write 2/18/80 H/S/T, with 512 bytes per sector. Go outside these logical parameters and you might get errors, you might get (or write) garbage somewhere, or the drive may lock up completely. Many can't read Distribution Media Format (DMF), for example – scruss Oct 27 '22 at 16:36