Repair a Corrupted USB Stick with fsck.vfat

Fix FAT32 filesystem errors on flash drives and SD cards that Windows left dirty or Linux mounts read-only.

LinuxfilesystemdiskrepairusbMedium risk
Unmount the drive, then run sudo fsck.vfat -a /dev/sdb1 to automatically repair the FAT filesystem without prompts.

01Command

Command
$ sudo fsck.vfat -a /dev/sdb1

02What it does

The dosfstools package's fsck.vfat (same binary as fsck.fat) validates the two FAT tables, directory entries and cluster chains of a FAT12/16/32 filesystem. The -a flag applies the non-destructive fixes automatically, while -r asks about every repair and -v prints details — run plain fsck.vfat first if you want to see what is wrong. This resolves the common 'volume is dirty' and read-only-mount situations on flash media.

03Risk

RiskMedium risk
Requirementsdosfstools package (fsck.vfat / fsck.fat)
!Warning: Always unmount the device first and never repair the wrong device node — check with lsblk; if the stick holds irreplaceable data, copy it off with ddrescue before any repair attempt.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-19 · Category: Files & Folders

06Related solutions