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.
01Command
$ sudo fsck.vfat -a /dev/sdb102What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- fsck.fat(8) — Ubuntu man page (dosfstools)Evidence: Man page text includes -a (automatically repair without prompts) and -v verbose mode, confirming the repair flags.
- fsck.fat(8) — check and repair MS-DOS FAT filesystemsEvidence: Page documents the -a option ('Automatically repair the file system without any prompts') and fsck.vfat as a synonym; confirms 'fsck.fat' and '-a' appear in the text.
Last verified: 2026-09-19 · Category: Files & Folders
06Related solutions
autoremove deletes no-longer-needed dependency packages, and clean wipes the downloaded .deb cache in /var/cache/apt/archives.
ncdu scans a directory tree, then lets you browse sizes, navigate, and delete space hogs with one keypress.
Check how much space the binary journal consumes and permanently trim it by size, age, or file count.