PDA

View Full Version : How do I check for bad sectors on my USB disc?



anticuchos
11-20-2005, 02:10 PM
I have a 4 GB HDD hooked onto my box via an external enclosure.

How do I check for bad sectors? And how long would it take to check a 4 GB?

OErjan
11-20-2005, 02:57 PM
how? depends on filesystem and exactly what you want. manuals for the comands (in bold) below should help.
e2fsck
http://www.die.net/doc/linux/man/man8/e2fsck.8.html
dosfsck
http://www.die.net/doc/linux/man/man8/dosfsck.8.html
reiserfsck
http://www.die.net/doc/linux/man/man8/reiserfsck.8.html

just an example, I could do this, e2fsck -fcpv /dev/hdq99, on the unmounted filesystem on disk hdq and partition 99 (unlikely to exist on your system), it would make a thurough check and try to repair the filesystem togheter with marking bad blocks. be prepared for several hours for it to do its job, likely less but...
Just so you now, it is a risky operation as it might foul things beyond repair if you are unlucky (any operation on a HDD can do that).

speed? depends on interface, is it usb? then we need to know if it is; usb1, usb1.1 or usb2?
same for scsi and firewire. these all have diferent speeds, and they all have diferent variations...

Dave_Bechtel
11-22-2005, 08:46 PM
' man badblocks '

' time badblocks -c 1024 -o badblocks.txt -n -s -v /dev/sda '


I have a 4 GB HDD hooked onto my box via an external enclosure.

How do I check for bad sectors? And how long would it take to check a 4 GB?