Web lists-archives.com

Re: Formatting a 32G or 16G SD card?




Le 03/01/2019 à 11:35, Jonathan Dowland a écrit :
On Thu, Jan 03, 2019 at 12:07:21AM -0800, John Conover wrote:
I'm want to format a "standard" 16G/32G SD card to OEM format.

What is "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?

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.

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.

You then write a MBR-type filesystem

Nonsense. You mean a partition table or disk label.

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.

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.