I’m doing some retrocomputing, and needed floppy image files to do things. It’s fine to download them off the ‘net, but once in a while you just need a blank floppy image.
I needed 1.2MB disks for my Coherent virtual machine, and couldn’t easily find how to create them. 2.88MB disk images are useful for making bootable CD ROM images, or were. Everyone said how to create 1.44MB 3.5″ disc images, and that’s not what I needed, so here’s how to create all the common sizes.
They’re easy to make, under Linux, anyway:
dd if=/dev/zero of=/path/to/new/image.img bs=512 count=<sectors>
The size in count determines what size of floppy image this is:
Size | Type | Form Factor | Sectors |
360KB | DSDD | 5.25″ | 720 |
1.2MB | DSHD | 5.25″ | 2400 |
720KB | DSDD | 3.5″ | 1440 |
1.44MB | DSHD | 3.5″ | 2880 |
2.88MB | DSED | 3.5″ | 5760 |
This sector list came from this Floppy Disk Information page and is here mostly so I don’t lose it.
Once you have a floppy image, you can put a FAT file system on it with mkfs:
/sbin/mkfs.msdos /path/to/new/image.img
(Note that you should be able to skip the dd and use -C with mkfs.msdos, but the sizing is then in blocks not sectors.)
Neither of those commands requires special access; they’re just operating on files you own. To mount the floppy image requires root access:
sudo mount -o loop /path/to/new/image.img /path/to/mount
Use umount to remove the mount and free the floppy image for other use:
sudo umount /path/to/mount
If you don’t have sudo access, you can use mtools to manipulate the floppy image directly without mounting it. They used to be quite commonly installed, but I suspect are not as frequently availble now. They’re available in all the usual places, see the man pages. To install them on OpenSUSE Linux you can use the package manager, but it needs root access again:
sudo zypper install mtools mtools-doc
This gives you access to mcopy, mcd, etc. I usually just mount the disc as above and then copy files to that path with cp.
Tags: coherent, floppy, retrocomputing