Discussion:
Formatting a 32G or 16G SD card?
(too old to reply)
John Conover
2019-01-03 08:10:01 UTC
Permalink
I'm want to format a "standard" 16G/32G SD card to OEM format.

Could someone please verify that the following will do this:

mkdosfs -I /dev/sdX
fdisk /dev/sdX n,p,1,default,default,w
mkfs.vfat /dev/sdX1

It seems to work, but could someone please verify that its correct?

Thanks,

John
--
John Conover, ***@rahul.net, http://www.johncon.com/
Jonathan Dowland
2019-01-03 10:40:02 UTC
Permalink
Post by John Conover
I'm want to format a "standard" 16G/32G SD card to OEM format.
mkdosfs -I /dev/sdX
fdisk /dev/sdX n,p,1,default,default,w
mkfs.vfat /dev/sdX1
It seems to work, but could someone please verify that its correct?
The "mkdosfs" seems to be superfluous, to me. As far as I can see, that
will put a FAT16 filesystem directly onto the device. You then write a
MBR-type filesystem over the top of it, and then a FAT32 filesystem into
the sole partition.

That said the documentation for mkdosfs "-I" is pretty unclear so
perhaps it's doing something that you intend and I have missed.

I assume the arguments to fdisk are intended to indicate the
interactive options you would supply when running it and are not
explicitly command-line arguments. I think fdisk will suggest an offset
for the partition that is a multiple of the physical block size already,
which you probably want.
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.
Pascal Hambourg
2019-01-03 20:10:02 UTC
Permalink
Post by Jonathan Dowland
Post by John Conover
I'm want to format a "standard" 16G/32G SD card to OEM format.
What is "OEM format" ?
Post by Jonathan Dowland
Post by John Conover
   mkdosfs -I /dev/sdX
   fdisk /dev/sdX n,p,1,default,default,w
   mkfs.vfat /dev/sdX1
It seems to work, but could someone please verify that its correct?
The "mkdosfs" seems to be superfluous, to me.
It does not seem to, it is. It may also cause a lot of confusion if
enough of the FAT boot sector is left untouched by the partition table.

Also, note that mkdosfs is the same as mkfs.vfat.
Post by Jonathan Dowland
As far as I can see, that
will put a FAT16 filesystem directly onto the device.
No, the FAT type is chosen from the device size unless explicitly
specified. 16 or 32 GB will select FAT32.
Post by Jonathan Dowland
You then write a MBR-type filesystem
Nonsense. You mean a partition table or disk label.
Post by Jonathan Dowland
and then a FAT32 filesystem into the sole partition.
Because the FAT type is chosen from the device size. Not because the
command is invoked as mkfs.vfat. VFAT has nothing to do with FAT32, it
just adds support for long file names on top of any FAT type and is only
a mount-time feature.
Post by Jonathan Dowland
That said the documentation for mkdosfs "-I" is pretty unclear so
perhaps it's doing something that you intend and I have missed.
-I forces mkdosfs to accept a whole unpartitioned device.
Jonathan Dowland
2019-01-04 10:00:02 UTC
Permalink
Post by Pascal Hambourg
Post by Jonathan Dowland
You then write a MBR-type filesystem
Nonsense. You mean a partition table or disk label.
Thank you yes, that was a typo ("Nonsense" is a bit harsh)
Post by Pascal Hambourg
Post by Jonathan Dowland
That said the documentation for mkdosfs "-I" is pretty unclear so
perhaps it's doing something that you intend and I have missed.
-I forces mkdosfs to accept a whole unpartitioned device.
Perhaps you could consider writing a patch for the man page.
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.
Curt
2019-01-04 13:40:01 UTC
Permalink
Post by Jonathan Dowland
Post by Pascal Hambourg
Post by Jonathan Dowland
You then write a MBR-type filesystem
Nonsense. You mean a partition table or disk label.
Thank you yes, that was a typo ("Nonsense" is a bit harsh)
Neither does "typo" appear to be the proper term for it. Rather it seems
your statement falls somewhere between nonsense and typographical error
into that vast, catch-all category sometimes referred to as "I misspoke."
Post by Jonathan Dowland
Post by Pascal Hambourg
Post by Jonathan Dowland
That said the documentation for mkdosfs "-I" is pretty unclear so
perhaps it's doing something that you intend and I have missed.
-I forces mkdosfs to accept a whole unpartitioned device.
Perhaps you could consider writing a patch for the man page.
-I It is typical for fixed disk devices to be partitioned so, by default, you are not permitted
to create a filesystem across the entire device. mkfs.fat will complain and tell you that
it refuses to work. This is different when using MO disks. One doesn't always need parti‐
tions on MO disks. The filesystem can go directly to the whole disk. Under other OSes this
is known as the 'superfloppy' format. This switch will force mkfs.fat to work properly.

I think PH's inference not too arduous from the above, frankly.

But how about:

-I When using MO disks, where partitions aren't always required, modifies
mkfs.fat's default behavior, allowing it to write the filesystem across the
entire, unpartitioned device (called 'superfloppy' format under some
other OSes).
Jonathan Dowland
2019-01-04 16:30:03 UTC
Permalink
Post by Curt
-I When using MO disks, where partitions aren't always required, modifies
mkfs.fat's default behavior, allowing it to write the filesystem across the
entire, unpartitioned device (called 'superfloppy' format under some
other OSes).
Much better. But what does MO stand for?
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.
Curt
2019-01-04 16:40:01 UTC
Permalink
Post by Jonathan Dowland
Post by Curt
-I When using MO disks, where partitions aren't always required, modifies
mkfs.fat's default behavior, allowing it to write the filesystem across the
entire, unpartitioned device (called 'superfloppy' format under some
other OSes).
Much better. But what does MO stand for?
I haven't the slightest idea (but assumed you folks in the know knew,
though)!

(Having now looked it seems MO stands for "Magneto-optical.)

https://en.wikipedia.org/wiki/Magneto-optical_drive
r***@gmail.com
2019-01-05 04:00:01 UTC
Permalink
Post by Curt
Post by Jonathan Dowland
Much better. But what does MO stand for?
I haven't the slightest idea (but assumed you folks in the know knew,
though)!
(Having now looked it seems MO stands for "Magneto-optical.)
https://en.wikipedia.org/wiki/Magneto-optical_drive
Ok, but that begs the question (or doesn't be the question, depending on
whether you are American or British), how did we get from SD cards to MO
drives?
t***@tuxteam.de
2019-01-04 16:40:02 UTC
Permalink
Post by Jonathan Dowland
Post by Curt
-I When using MO disks, where partitions aren't always required, modifies
mkfs.fat's default behavior, allowing it to write the filesystem across the
entire, unpartitioned device (called 'superfloppy' format under some
other OSes).
Much better. But what does MO stand for?
I'd guess "magneto-optical". But I might be wrong.

Cheers
-- tomás
Thomas Schmitt
2019-01-04 17:50:01 UTC
Permalink
Hi,
Post by t***@tuxteam.de
Post by Jonathan Dowland
what does MO stand for?
I'd guess "magneto-optical".
It would match the term "superfloppy" in man mkdosfs.
(Larger, more heavy, even less reliable than floppy disks.)

Possibly some of the MO genes survived in DVD-RAM. E.g. the glossy rectangles
sprinkled over the writable surface or the cartridges around early DVD-RAM
media.


Have a nice day :)

Thomas
Pascal Hambourg
2019-01-04 19:10:01 UTC
Permalink
Post by Jonathan Dowland
 -I When using MO disks, where partitions aren't always required, modifies
    mkfs.fat's default behavior, allowing it to write the filesystem across the
    entire, unpartitioned device (called 'superfloppy' format under some
    other OSes).
Much better.
I disagree. It misleads the reader into believing that the option
applies only to magneto-optical disks, while it also applies to fixed
disks and, I guess, any other storage device type.

IMO, the default behaviour does not make sense and the -I option should
not even exist ; mkfs.fat should accept to create a filesystem on an
entire unpartitioned device of any type by default, just like other
mkfs.* do.
t***@tuxteam.de
2019-01-05 09:30:02 UTC
Permalink
Post by Pascal Hambourg
Post by Jonathan Dowland
 -I When using MO disks, where partitions aren't always required, modifies
    mkfs.fat's default behavior, allowing it to write the filesystem across the
    entire, unpartitioned device (called 'superfloppy' format under some
    other OSes).
Much better.
I disagree. It misleads the reader into believing that the option
applies only to magneto-optical disks, while it also applies to
fixed disks and, I guess, any other storage device type.
Actually most of my USB sticks have no partition table, just one
filesystem on them. Scares the hell out of MACs and Windows boxes :-)

Cheers
-- tomás
Joe
2019-01-05 09:40:02 UTC
Permalink
On Sat, 5 Jan 2019 10:20:51 +0100
Post by t***@tuxteam.de
Post by Pascal Hambourg
Post by Jonathan Dowland
 -I When using MO disks, where partitions aren't always required,
modifies mkfs.fat's default behavior, allowing it to write the
filesystem across the entire, unpartitioned device (called
'superfloppy' format under some other OSes).
Much better.
I disagree. It misleads the reader into believing that the option
applies only to magneto-optical disks, while it also applies to
fixed disks and, I guess, any other storage device type.
Actually most of my USB sticks have no partition table, just one
filesystem on them. Scares the hell out of MACs and Windows boxes :-)
The problem with those is that they *nearly* work on an OS which doesn't
understand them. Just well enough to cause trouble...
--
Joe
t***@tuxteam.de
2019-01-05 11:00:02 UTC
Permalink
Post by Joe
On Sat, 5 Jan 2019 10:20:51 +0100
[...]
Post by Joe
Post by t***@tuxteam.de
Actually most of my USB sticks have no partition table, just one
filesystem on them. Scares the hell out of MACs and Windows boxes :-)
The problem with those is that they *nearly* work on an OS which doesn't
understand them. Just well enough to cause trouble...
My experience is that the OS considers them as "unformatted" and offers
to "format" them. Perhaps an advanced Windows or Mac user can push their
OSes beyond that, but I haven't met many advanced users for those systems.

Just don't hand out anything with data on it you can't recover...

Cheers
-- t
Jonathan Dowland
2019-01-07 12:30:01 UTC
Permalink
Post by Pascal Hambourg
I disagree. It misleads the reader into believing that the option
applies only to magneto-optical disks, while it also applies to fixed
disks and, I guess, any other storage device type.
That's good to know: I don't think the original text made this point
clear either.
Post by Pascal Hambourg
IMO, the default behaviour does not make sense and the -I option
should not even exist ; mkfs.fat should accept to create a filesystem
on an entire unpartitioned device of any type by default, just like
other mkfs.* do.
Actually I agree with you, this would be a smart change to make. Here's
where an interested party should file the request and/or patch for the
change, fwiw: https://github.com/dosfstools/dosfstools

(I looked this up because I might do it myself)
--
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Jonathan Dowland
⢿⡄⠘⠷⠚⠋⠀ https://jmtd.net
⠈⠳⣄⠀⠀⠀⠀ Please do not CC me, I am subscribed to the list.
r***@gmail.com
2019-01-05 03:20:02 UTC
Permalink
Post by Curt
Post by Jonathan Dowland
Post by Pascal Hambourg
Post by Jonathan Dowland
You then write a MBR-type filesystem
Nonsense. You mean a partition table or disk label.
Thank you yes, that was a typo ("Nonsense" is a bit harsh)
Neither does "typo" appear to be the proper term for it. Rather it seems
your statement falls somewhere between nonsense and typographical error
into that vast, catch-all category sometimes referred to as "I misspoke."
I add grammos and thinkos to typos as errors that I sometimes make (or see
others make).
Oh, and I should come up with some more, like:

* nothinkos

* an "o" to describe using the wrong word from among words that sound
alike, e.g., to, too, two and such. (There is a word for those kind of words
-- oh, is it homophones? (and then homophonos?)
r***@gmail.com
2019-01-05 03:20:02 UTC
Permalink
Post by Curt
Post by Jonathan Dowland
Post by Pascal Hambourg
Post by Jonathan Dowland
You then write a MBR-type filesystem
Nonsense. You mean a partition table or disk label.
Thank you yes, that was a typo ("Nonsense" is a bit harsh)
Neither does "typo" appear to be the proper term for it. Rather it seems
your statement falls somewhere between nonsense and typographical error
into that vast, catch-all category sometimes referred to as "I misspoke."
I add grammos and thinkos to typos as errors that I sometimes make (or see
others make).
r***@gmail.com
2019-01-05 03:40:01 UTC
Permalink
Post by Curt
Post by Jonathan Dowland
Perhaps you could consider writing a patch for the man page.
-I It is typical for fixed disk devices to be partitioned so, by default,
you are not permitted to create a filesystem across the entire device.
mkfs.fat will complain and tell you that it refuses to work. This is
different when using MO disks. One doesn't always need parti‐ tions on
MO disks. The filesystem can go directly to the whole disk. Under other
OSes this is known as the 'superfloppy' format. This switch will force
mkfs.fat to work properly.
I think PH's inference not too arduous from the above, frankly.
-I When using MO disks, where partitions aren't always required, modifies
mkfs.fat's default behavior, allowing it to write the filesystem
across the entire, unpartitioned device (called 'superfloppy' format under
some other OSes).
From the peanut gallery, that (the second) looks good to me, but I missed
something in the thread -- does MO refer to magneto-optical disks?
Curt
2019-01-05 09:10:02 UTC
Permalink
Post by r***@gmail.com
Post by Curt
Post by Jonathan Dowland
Perhaps you could consider writing a patch for the man page.
-I It is typical for fixed disk devices to be partitioned so, by default,
you are not permitted to create a filesystem across the entire device.
mkfs.fat will complain and tell you that it refuses to work. This is
different when using MO disks. One doesn't always need parti‐ tions on
MO disks. The filesystem can go directly to the whole disk. Under other
OSes this is known as the 'superfloppy' format. This switch will force
mkfs.fat to work properly.
I think PH's inference not too arduous from the above, frankly.
-I When using MO disks, where partitions aren't always required, modifies
mkfs.fat's default behavior, allowing it to write the filesystem
across the entire, unpartitioned device (called 'superfloppy' format under
some other OSes).
From the peanut gallery, that (the second) looks good to me, but I missed
something in the thread -- does MO refer to magneto-optical disks?
Right. Unfortunately, now we've been informed by PH that not only is the
previous, more verbose version less clear but that it is also wrong,
which makes the newer version merely more clearly and succinctly wrong,
I guess.

Back to the drawing board (I was working simply to improve clarity
without the knowledge to correct inaccuracy)!
Loading...