
Hi All, I've got a USB mem stick that seems to be dodgy, but I'm not sure. I =know= it's not worth the time and effort financially, but I'd like to be sure it's the stick, and not some other part of the system. On this web page... superuser.com/questions/376274/check-the-physical-health-of-a-usb-stick-in-linux Someone suggested using this command... sudo badblocks -w -s -o usbstick.log /dev/sdz ... where sdz is substituted for the actual device. But, when I try the command with the stick unmounted, I get an error message to this effect... No such file or directory while trying to determine device size. And, when I try the command with the stick mounted, I get an error message to this effect... /dev/sdb is apparently in use by the system. It is not safe to use badblocks! What's the obvious escape from this Catch-22 that I don't see? Thanks. Carl Bayswater

Carl Turney <carl@boms.com.au> wrote:
But, when I try the command with the stick unmounted, I get an error message to this effect...
No such file or directory while trying to determine device size.
If there is a partition on the device, what happens if you try the command with, e.g., /dev/sdb1?

On 12/02/13 12:19, Carl Turney wrote:
Someone suggested using this command... sudo badblocks -w -s -o usbstick.log /dev/sdz
No such file or directory while trying to determine device size.
The usb flash definitely has to be unmounted before doing this. However, unmounting should not remove the entries from /dev Perhaps try doing the unmount from the command line (I'm assuming the drive is auto mounted when you plug it in, and you may have more than one partition on it). Check what drives and partitions there are (the -l is important) ls /dev/sd* sudo fdisk -l Make sure all the partitions are unmounted, eg sudo umount /dev/sdb1 And then run the badblocks test (I'd suggest a read only test first, as a quick first pass). Also keep in mind a -w write test will wipe the drive. sudo badblocks -s -o usbstick.log /dev/sdb regards, Glenn -- sks-keyservers.net 0xb1e82ec9228ac090
participants (3)
-
Carl Turney
-
Glenn McIntosh
-
Jason White