Discussion:
Format an MS-DOS floppy on /dev/sdc
(too old to reply)
Anders Andersson
2019-03-17 12:30:01 UTC
Permalink
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
Normally I would have used mformat from the mtools package, but it
appears that I can not supply a device name, just "emulated names"
like A: which are then translated to /dev/fd0 etc.
The problem is that my disk drive shows up as a SCSI device on
/dev/sdc and I can not find a way to tell mformat to use it, so it
seems that I have to use the traditional mkfs.fat to format my disk.
However, there are dozens of parameters such as number of FATs, FAT
size, "media type", and I don't know anything about that! Can someone
figure out what type of magic I need to supply to mkfs.fat for it to
do exactly what mformat would to do a floppy, or alternatively, how to
make mformat work with /dev/sdc?
Curt
2019-03-17 12:50:01 UTC
Permalink
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
Normally I would have used mformat from the mtools package, but it
appears that I can not supply a device name, just "emulated names"
like A: which are then translated to /dev/fd0 etc.
It seems you're supposed to use '/etc/mtools.conf' for this kind of
thing.

drive m: file="/dev/sdc"

Then:

mformat m:

This from a very cursory examination of the problem on the internets.
Post by Anders Andersson
The problem is that my disk drive shows up as a SCSI device on
/dev/sdc and I can not find a way to tell mformat to use it, so it
seems that I have to use the traditional mkfs.fat to format my disk.
However, there are dozens of parameters such as number of FATs, FAT
size, "media type", and I don't know anything about that! Can someone
figure out what type of magic I need to supply to mkfs.fat for it to
do exactly what mformat would to do a floppy, or alternatively, how to
make mformat work with /dev/sdc?
--
“Let us again pretend that life is a solid substance, shaped like a globe,
which we turn about in our fingers. Let us pretend that we can make out a plain
and logical story, so that when one matter is despatched--love for instance--
we go on, in an orderly manner, to the next.” - Virginia Woolf, The Waves
Dan Ritter
2019-03-17 16:40:02 UTC
Permalink
Post by Curt
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
Normally I would have used mformat from the mtools package, but it
appears that I can not supply a device name, just "emulated names"
like A: which are then translated to /dev/fd0 etc.
It seems you're supposed to use '/etc/mtools.conf' for this kind of
thing.
drive m: file="/dev/sdc"
This from a very cursory examination of the problem on the internets.
Also doable:

mkfs.vfat /dev/sdc

-dsr-
Anders Andersson
2019-03-20 19:50:01 UTC
Permalink
Post by Curt
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
Normally I would have used mformat from the mtools package, but it
appears that I can not supply a device name, just "emulated names"
like A: which are then translated to /dev/fd0 etc.
It seems you're supposed to use '/etc/mtools.conf' for this kind of
thing.
drive m: file="/dev/sdc"
Thanks! This worked well, all the mtools utilities now works with the USB drive.

I wonder when the GNU people will understand that no one wants their
enforced info files and start write actual manual pages for the tools.
Normally the manual pages has a "See Also" section, but mformat does
not mention the configuration file or refers to the mtools manual page
which does.
David Wright
2019-03-17 16:50:01 UTC
Permalink
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
I'm not sure that you really can. What's your reasoning for
doing this? Are you just spoiling for an unnecessary fight?
Or do you really want to boot off it?
Post by Anders Andersson
Normally I would have used mformat from the mtools package, but it
appears that I can not supply a device name, just "emulated names"
like A: which are then translated to /dev/fd0 etc.
It's a long time ago, but I seem to remember they did a good job.
Post by Anders Andersson
The problem is that my disk drive shows up as a SCSI device on
/dev/sdc and I can not find a way to tell mformat to use it, so it
seems that I have to use the traditional mkfs.fat to format my disk.
However, there are dozens of parameters such as number of FATs, FAT
size, "media type", and I don't know anything about that! Can someone
figure out what type of magic I need to supply to mkfs.fat for it to
do exactly what mformat would to do a floppy, or alternatively, how to
make mformat work with /dev/sdc?
Here's an example dialogue for formatting a FAT disk. Try it,
see if it meets the unwritten criteria that apply to your
instance and if it does, stick with it. If not, just try again
with any mtools advice you get. (FAT format will stick around.
Who knows about mtools?)

# You should always blank the start of FAT partitions/disks
# dd bs=512 of=/dev/sdz if=/dev/zero count=2048
2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB) copied, 0.3333 s, 3.1 MB/s
#

##

# This step is optional. Floppies are unpartitioned.
# Hard drives almost never are. This may or may not matter to you.
# fdisk /dev/sdz

Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xa7c66574.

Command (m for help): p
Disk /dev/sdz: 3.8 GiB, 4089446400 bytes, 7987200 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: 0xa7c66574

Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-7987199, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-7987199, default 7987199):

Created a new partition 1 of type 'Linux' and of size 3.8 GiB.

Command (m for help): t
Selected partition 1
Partition type (type L to list all types): c
Changed type of partition 'Linux' to 'W95 FAT32 (LBA)'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

#

##

# If you skipped the previous step, skip this to the next.
# This is for a PARTITIONED device.
# mkdosfs -v -i 20140440 -F 32 -n columbine4g /dev/sdz1
mkfs.fat 4.1 (2017-01-24)
mkfs.fat: warning - lowercase labels might not work properly with DOS
or Windows
/dev/sdz1 has 126 heads and 62 sectors per track,
hidden sectors 0x0800;
logical sector size is 512,
using 0xf8 media descriptor, with 7985152 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 7784 sectors, and provides 996194 clusters.
There are 32 reserved sectors.
Volume ID is 20140440, volume label columbine4g.
#

##

# For completeness, here's an up-to-date dialogue for
# an UNPARTITIONED device. This is a stick. As you
# have a disk, you might need to add -I if you
# *really* want it unpartitioned.

# mkdosfs -v -i 20140440 -F 32 -n COLUMBINE4G /dev/sdz
mkfs.fat 4.1 (2017-01-24)
attribute "partition" not found
/dev/sdz has 126 heads and 62 sectors per track,
hidden sectors 0x0000;
logical sector size is 512,
using 0xf8 media descriptor, with 7987200 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 7792 sectors, and provides 996448 clusters.
There are 32 reserved sectors.
Volume ID is 20140440, volume label COLUMBINE4G.
#

I don't have 26 devices, but sdz prevents casual cut-and-paste.
I use the approximate acquisition date for the VSN≡UUID (8 hex
digits) and, against recommendations, I use lowercase LABELs,
like columbine4g, and utf8 filenames. For those who care,
the labels are whatever the companies wrote on them, plus the
size, but cut to 11 chars.

Cheers,
David.
Anders Andersson
2019-03-20 20:10:02 UTC
Permalink
Post by David Wright
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
I'm not sure that you really can. What's your reasoning for
doing this? Are you just spoiling for an unnecessary fight?
Or do you really want to boot off it?
I want to use a floppy disk to transfer information between computers
and other devices which expects 3.5" HD diskette formatted for use
with DOS. Since it was the industry standard for "sneakernet" file
transfer for over a decade, I don't think it's a strange use case.
What did I miss?
Stefan Monnier
2019-03-20 20:20:01 UTC
Permalink
Post by Anders Andersson
Since it was the industry standard for "sneakernet" file
transfer for over a decade, I don't think it's a strange use case.
What did I miss?
The two decades that passed by since? ;-)

Especially since the media was notoriously unreliable back then and it
probably hasn't gotten better with age.


Stefan
David Wright
2019-03-21 02:20:01 UTC
Permalink
Post by Anders Andersson
Post by David Wright
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
I'm not sure that you really can. What's your reasoning for
doing this? Are you just spoiling for an unnecessary fight?
Or do you really want to boot off it?
I want to use a floppy disk to transfer information between computers
and other devices which expects 3.5" HD diskette formatted for use
with DOS. Since it was the industry standard for "sneakernet" file
transfer for over a decade, I don't think it's a strange use case.
What did I miss?
I think *I* missed, or rather misread, the first two lines of your
post (assuming the drive was what's commonly called a hard drive).
I think I understand what you're asking now, so you can delete at
least my first paragraph.

Unless you've a stack of real 3.5" diskettes which you haven't yet
got round to transferring onto a better format¹, then I think you
probably wasted your money on the drive. The port that you plug
your drive into would support a wide range of cheap drives that
could be formatted with FAT16/32±VFAT if and as required. Or you
could just use USB sticks instead, which I would recognise as
being the modern sneakernet. Why limit yourself to 1.4MB?²

¹ There are scads of LPs, VHS tapes, and probably 78s, musicassettes,
reel-to-reel, etc. that need conversion, but there's more excuse
here for tardiness.

² Floppy storage appears to cost around 1$/MB. Without suggesting
your devices could handle 10TB drives, the cost of storage on
these can be as low as 2¢/GB. (Best Buy throws in a 32GB stick.)

Cheers,
David.
Kenneth Parker
2019-03-21 03:10:01 UTC
Permalink
I've often wanted to be a Curator, for a Computer History Museum.

Kenneth Parker

Stefan Monnier
2019-03-20 20:10:02 UTC
Permalink
Post by Anders Andersson
I got myself a USB 3.5" disk drive and want to format a 3.5" HD disk
so that it Just Works™ as a standard MS-DOS floppy.
Reading the manpage of mkfs.fat gives me the impression that

mkfs.fat /dev/sdc

should do the trick. Have you tried?


Stefan
Loading...