It’s much much easier then I thought!
You need to use dosfsck!
1. If not already installed, install dosfsck: (it’s in sbin)
sudo apt-get install dosfsck
2. Find your device name.
sudo blkid
You will get output that looks like:
/dev/sdf1: LABEL=”CANON_DC” UUID=”713B-5AE2″ TYPE=”vfat”
Your device name will PROBABLY be different.
3. Check the usb drive or sd card:
Remember that the device should NOT be mounted, and that it needs to run as root (sudo or su -)
sudo dosfsck -av /dev/sdf1
-a says to automatically repair.
-v says to use verbose output.
You will get output that looks like:
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 “PwrShot ”
Media byte 0xf8 (hard disk)
512 bytes per logical sector
32768 bytes per cluster
6304 reserved sectors
First FAT starts at byte 3227648 (sector 6304)
2 FATs, 32 bit entries
483328 bytes per FAT (= 944 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 4194304 (sector 8192)
120752 data clusters (3956801536 bytes)
63 sectors/track, 128 heads
8192 hidden sectors
7736320 sectors total
Reclaiming unconnected clusters.
Checking free cluster summary.
/dev/sdf1: 693 files, 29358/120752 clusters
No errors. Good to go. Look Ma! No Windows!
Wayno
Related Articles
1 user responded in this post
Yep, that comes in very handy. I’ve had to reformat usb drives and sansa music players before, and having those tools on linux is a life saver.