Memory card format fat

Asked by senthilnaathan

I formatted 2gb memory card using ubuntu 10.10 in fat.what is the default cluster or file allocation size can i check it.thanks.ubuntu is great.

Question information

English Edit question
Ubuntu dosfstools Edit question
No assignee Edit question
Solved by:
Eliah Kagan
Last query:
Last reply:
Revision history for this message
Best Eliah Kagan (degeneracypressure) said :

One way to do this is to run dosfsck on the device's device name. So, open a Terminal window (Applications > Accessories > Terminal), and first run:

mount | grep vfat

(To run a command in the Terminal, type or paste it into the Terminal and then press the enter key.)

That will tell you about all the vfat (FAT16 and FAT32) volumes that are currently mounted. Please note that the character between "mount" and "grep fat" is a pipe -- on a US English keyboard, it is produced by holding down shift and pressing the \ (backslash) key.

For example, on my system, with one FAT16 device plugged in, running that command gives me:

/dev/sdb1 on /media/MYFLASH type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)

Then you can run dosfsck on the device:

sudo dosfsck -v /dev/sdb1

The -v is so that it prints out detailed information, including the cluster size (and related parameters). When you run this command, you may be prompted for your password. As you enter it, you won't see any placeholder characters (like *). That's OK, just type it in and press enter.

As an example of what the output of that command should look like, on my system:

ek@Apok:~$ sudo dosfsck -v /dev/sdb1
dosfsck 3.0.9 (31 Jan 2010)
dosfsck 3.0.9, 31 Jan 2010, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "MSDOS5.0"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
      2048 bytes per cluster
         8 reserved sectors
First FAT starts at byte 4096 (sector 8)
         2 FATs, 16 bit entries
    126976 bytes per FAT (= 248 sectors)
Root directory starts at byte 258048 (sector 504)
       512 root directory entries
Data area starts at byte 274432 (sector 536)
     63346 data clusters (129732608 bytes)
63 sectors/track, 255 heads
        32 hidden sectors
    253920 sectors total
Checking for unused clusters.
/dev/sdb1: 7 files, 10/63346 clusters

And I can see from this that my device has 2048-byte clusters.

Revision history for this message
senthilnaathan (dssenthilnaathan) said :

Thanks Eliah Kagan, that solved my question.