Syntax for command mkfs.fat -? /dev/sdc1

I got as far as finding the command for this formatting of a usb sd card and fat32. But in my instructions for the flashing of the firmware of my 3d printer it clearly states the allocation unit size should be 4096. I cannot find the syntax to add this as an option. When I do the normal mkfs.fat -S4096/dev/sdc1 I get a formatted sd card allright, but when checking blockdev --getbsz /dev/sdc1 it throws 512 back at me.
Please tell me what I am doing wrong? My instruction video is unfortunately doing it on a windows machine and I refuse to use windows even if one is in the house (which there is but it is seriously the last resource).

You need to use mkfs.vfat for fat32

Seems like you forgot spaces. Try this:

mkfs.vfat -S 4096 /dev/your-device

EDIT: removed -C

tried that too, with no difference in the results. Also we tried to add -F32, thinking you had to specify the fat, but that also did not do anything different.

That was an editor typing error. In the terminal I wrote it with spaces in the right places, like this “sudo mkfs.fat -S 4096 /dev/sdc1”
I think if you leave the spaces out it will throw an error back at you anyway.

1 Like

try

sudo mkdosfs -F32 -S 4096 -I /dev/yourdevice

mkdosfs is based on mke2fs which in turn is
based on mkfs

the -I flag will force mkdosfs to work properly

2 Likes

Thank you,
I still don’t understand why this worked and the standard mkfs did not, while we used the correct syntax in some of our attempts, but this worked and now I can continue.
[kees@3dcase ~]$ sudo blockdev --getbsz /dev/sdc1
4096
And that is what I needed!
Thanks again, you are a star.

Glad it worked out!
I don’t know either, but it’s possible the mkfs.fat method also would have worked with the -I flag. It ignores and disables safety checks, whatever that means.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.