Check USB stick for physical health: badblocks

Step-by-Step descriptions of how to do things.
Post Reply
User avatar
^rooker
Site Admin
Posts: 1482
Joined: Fri Aug 29, 2003 8:39 pm

Check USB stick for physical health: badblocks

Post by ^rooker »

This is merely a short writedown of something I always forget for years now:
(Should work on most GNU/Linux distros, but I've usually used it on Debian-flavored ones (eg Xubuntu))

Assuming the to-be-checked storage media (eg USB-Stick, HDD, etc) has the physical device name of "/dev/sdX" (eg "/dev/sdc1")

Code: Select all

$ badblocks -nsv -o badblocks_list.log /dev/sdX
-n: non-destructive read-write test (Can be used on storage that already contains data)
-s: show progress
-v: verbose


Output while checking looks like this:
Checking for bad blocks in non-destructive read-write mode
From block 0 to 59055103
Checking for bad blocks (non-destructive read-write test)
Testing with random pattern: 2.97% done, 4:04 elapsed. (0/0/0 errors)

8)
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply