Menu

← Back to all posts

Tech

Finding bad blocks on USB flash drives

After a recent thorough cleaning of my office desk I found a handful of USB sticks. I knew some of them were more or less broken and some should be OK. But...

Neyts ZupanNeyts Zupan
  1. Install ext2fsx.
  2. Insert USB drive.
  3. Backup data from the USB drive because ‘badblocks’ removes all data from the stick.
  4. Identify USB drive in console.
$ mount
... snip ...
/dev/disk1 on /Volumes/NO NAME (msdos, local, nodev, nosuid, noowners)
  1. Unmount USB drive so we can run ‘badblocks’ on it.
$ sudo umount -f /Volumes/NO\ NAME/
  1. Run badblocks to identify and mark bad block

WARNING: badblocks removes all data on drive. Make sure you have a backup and that you don’t mistype the drive’s i

$ badblocks -vw /dev/disk1
  1. Use ‘Disk Utility’ to format the drive so you can actually use it.
Neyts Zupan

Neyts Zupan

Neyts is the Digital Overlord of Niteo, poking his nose into any and all technical things.