Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #206280 > unrolled thread

Format an MS-DOS floppy on /dev/sdc

Started byAnders Andersson <pipatron@gmail.com>
First post2019-03-17 13:30 +0100
Last post2019-03-20 21:10 +0100
Articles 10 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  Format an MS-DOS floppy on /dev/sdc Anders Andersson <pipatron@gmail.com> - 2019-03-17 13:30 +0100
    Re: Format an MS-DOS floppy on /dev/sdc Curt <curty@free.fr> - 2019-03-17 13:50 +0100
      Re: Format an MS-DOS floppy on /dev/sdc Dan Ritter <dsr@randomstring.org> - 2019-03-17 17:40 +0100
      Re: Format an MS-DOS floppy on /dev/sdc Anders Andersson <pipatron@gmail.com> - 2019-03-20 20:50 +0100
    Re: Format an MS-DOS floppy on /dev/sdc David Wright <deblis@lionunicorn.co.uk> - 2019-03-17 17:50 +0100
      Re: Format an MS-DOS floppy on /dev/sdc Anders Andersson <pipatron@gmail.com> - 2019-03-20 21:10 +0100
        Re: Format an MS-DOS floppy on /dev/sdc Stefan Monnier <monnier@iro.umontreal.ca> - 2019-03-20 21:20 +0100
        Re: Format an MS-DOS floppy on /dev/sdc David Wright <deblis@lionunicorn.co.uk> - 2019-03-21 03:20 +0100
          Re: Format an MS-DOS floppy on /dev/sdc Kenneth Parker <sea7kenp@gmail.com> - 2019-03-21 04:10 +0100
    Re: Format an MS-DOS floppy on /dev/sdc Stefan Monnier <monnier@iro.umontreal.ca> - 2019-03-20 21:10 +0100

#206280 — Format an MS-DOS floppy on /dev/sdc

FromAnders Andersson <pipatron@gmail.com>
Date2019-03-17 13:30 +0100
SubjectFormat an MS-DOS floppy on /dev/sdc
Message-ID<xCD5n-3Sv-3@gated-at.bofh.it>
  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?

[toc] | [next] | [standalone]


#206282

FromCurt <curty@free.fr>
Date2019-03-17 13:50 +0100
Message-ID<xCDoJ-3Zk-1@gated-at.bofh.it>
In reply to#206280
On 2019-03-17, Anders Andersson <pipatron@gmail.com> wrote:
>   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.

>   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

[toc] | [prev] | [next] | [standalone]


#206287

FromDan Ritter <dsr@randomstring.org>
Date2019-03-17 17:40 +0100
Message-ID<xCGZk-6if-19@gated-at.bofh.it>
In reply to#206282
Curt wrote: 
> On 2019-03-17, Anders Andersson <pipatron@gmail.com> wrote:
> >   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.

Also doable:

mkfs.vfat /dev/sdc

-dsr-

[toc] | [prev] | [next] | [standalone]


#206406

FromAnders Andersson <pipatron@gmail.com>
Date2019-03-20 20:50 +0100
Message-ID<xDPnP-yt-7@gated-at.bofh.it>
In reply to#206282
On Sun, Mar 17, 2019 at 1:46 PM Curt <curty@free.fr> wrote:
>
> On 2019-03-17, Anders Andersson <pipatron@gmail.com> wrote:
> >   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:

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.

[toc] | [prev] | [next] | [standalone]


#206288

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-03-17 17:50 +0100
Message-ID<xCH8Z-6lT-1@gated-at.bofh.it>
In reply to#206280
On Sun 17 Mar 2019 at 13:19:29 (+0100), Anders Andersson wrote:
>   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?

>   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.

>   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.

[toc] | [prev] | [next] | [standalone]


#206407

FromAnders Andersson <pipatron@gmail.com>
Date2019-03-20 21:10 +0100
Message-ID<xDPHc-Vd-1@gated-at.bofh.it>
In reply to#206288
On Sun, Mar 17, 2019 at 5:43 PM David Wright <deblis@lionunicorn.co.uk> wrote:
>
> On Sun 17 Mar 2019 at 13:19:29 (+0100), Anders Andersson wrote:
> >   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?

[toc] | [prev] | [next] | [standalone]


#206409

FromStefan Monnier <monnier@iro.umontreal.ca>
Date2019-03-20 21:20 +0100
Message-ID<xDPQR-YB-1@gated-at.bofh.it>
In reply to#206407
> 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

[toc] | [prev] | [next] | [standalone]


#206416

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2019-03-21 03:20 +0100
Message-ID<xDVtf-4uV-3@gated-at.bofh.it>
In reply to#206407
On Wed 20 Mar 2019 at 21:01:00 (+0100), Anders Andersson wrote:
> On Sun, Mar 17, 2019 at 5:43 PM David Wright <deblis@lionunicorn.co.uk> wrote:
> > On Sun 17 Mar 2019 at 13:19:29 (+0100), Anders Andersson wrote:
> > >   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.

[toc] | [prev] | [next] | [standalone]


#206419

FromKenneth Parker <sea7kenp@gmail.com>
Date2019-03-21 04:10 +0100
Message-ID<xDWfD-51U-1@gated-at.bofh.it>
In reply to#206416

[Multipart message — attachments visible in raw view] — view raw

I've often wanted to be a Curator, for a Computer History Museum.

Kenneth Parker

[toc] | [prev] | [next] | [standalone]


#206408

FromStefan Monnier <monnier@iro.umontreal.ca>
Date2019-03-20 21:10 +0100
Message-ID<xDPHc-Vd-13@gated-at.bofh.it>
In reply to#206280
>   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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web