This is an old revision of the document!
Handy commands:
lsblk
udevadm info --query=all --name=/dev/sd<X> | grep ID_SERIAL_SHORT
Handy Commands:
apt-get install gnome-disk-utility
gnome-disks
apt-get install smartmontools
smartctl -H /dev/sd<X>
smartctl -i /dev/sd<X>
gnome-disks
Open “SMART Data & Self-Tests”, click “Start Self-Test”, and select a test to run.
smartctl --test=short /dev/sd<X>
smartctl --test=long /dev/sd<X>
badblocks -vws /dev/sd<X>
If the hardware is suspect, then the first thing to do is get a byte-for-byte copy of the drive's contents into a disk image file. The less time spent using possibly faulty hardware the better.
ddrescue -A -f /dev/sd<X> broken.img
This copy will remain unchanged while we work. Make a copy of this file, and only alter the copy. This way, if anything goes awry then we can go back to square one without having to rely on possibly faulty hardware again.
cp broken.img work.img
Use testdisk to search for and repair disk partitions.
testdisk work.img
Using testdisk involves using the arrow, escape, and enter keys.