Recovering data from a usb hard drive

Soldato
Joined
31 Dec 2003
Posts
4,749
Location
Stoke on Trent
hi all,

I have a thread in General Hardware but thought I'd post here now as it's become a linux issue.

If I do "df" and can't see an attached USB drive (which I think to be formatted at least partly in ntfs), does it mean that the drive is basically shafted? I believe this drive to be troublesome but not completely dead as per my op.
 
df will only show you mounted drives.

Does it show up under "fdisk -l" (as root/sudo)?

If it doesn't show up under fdisk then yes it's most likely a hardware error and you can kiss goodbye to it.

If however it shows up under fdisk, first take a 'dd' dump of the partition you want to save e.g "dd if=/dev/sda1 of=/home/me/mydump.bin", where sda1 is the drive in question. Once that's done, try mounting it and see if it's browsable - if it's not run something like testdisk against it.
 
Yeah.. df just shows mounted devices.

Plug it in and type dmesg this will show if the kernel recognises it and shows the device

(e.g. /dev/sdb )

You can then mount /dev/sdb to the filesystem.. e.g

sudo mount /dev/sdb /mnt

If you've overwritten data, or need to recover, thy the knoppix bootable distro, and use am application called photorec
 
thanks guys, I managed to get it to show up in df in the end, but by keep wiggling it around in my caddy, then every now and again after a file copy from the drive, it gave me input/output errors, I'm putting this down to a duff drive. I have managed to get the important docs off it anyway so i'm really happy, thanks for your help! :D

Plus now I know how to do this it's a very very handy skill indeed :)
 
yea was going to reply to you in GH mate, thanks very much :D learned a useful trick there as well, i'm always asked to do this in my job!
 
Safecopy is a good tool if you're getting medium errors. You can run it over and over and it won't re-copy stuff that came off without an I/O error. In theory after enough passes you get a good copy of your data.

http://safecopy.sourceforge.net/

Your distro probably comes with it, or it may be in the repo.
 
Last edited:
Back
Top Bottom