Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My Ubuntu HDD failed today(hardware). I can't mount it, but there are some files which I need to recover before I get manufacturer replacement. Is there any software which will let me scan device itself without mounting it in attempt to find files and restore on external storage?

I tend to thing that most of the ext4 partition may be readable and only those sectors carrying data for mounting failed. I have NTFS partitions on that HDD and able to successfully read them.

share|improve this question

Depending on how badly corrupted the filesystem, you may be able to retrieve some files using debugfs. Try opening the partition with 'debugfs /dev/sdXn'. If that fails use the '-c' flag. Then you can use 'ls' and 'cd' to see what is still available. 'write' can be used to recover individual files; 'rdump' can be used to dump directory trees.

Good luck :)

share|improve this answer

If your hard drive has failed you're pretty much beyond what you can do with software. Your best bet would be a data recovery company.

If you can still access the drive (it spins up and some areas are readable) you can try some at-home data recovery software (search the tag here or Google for an enormous list of options, both free and commercial).
Imaging the whole drive with ddrescue might also be a good option - particularly if the drive is just beginning to fail. Getting an image of it now, before the problems get any worse, will maximize your chances of recovering data.

share|improve this answer
I'd definitely try the ddrescue method to image it, if testdisk can't get to the partition to recover files. Testdisk, then ddrescue, then swearing and throwing it around like a very angry primate. That won't help any more but it makes me feel better. – Bart Silverstrim Feb 9 '12 at 2:47
I've never actually used testdisk, but my usual step after ddrescue is "viking funeral" – voretaq7 Feb 9 '12 at 21:04
I used testdisk against a disk image; it did work against a raw image. Testdisk is actually really useful for partition and file rescues. – Bart Silverstrim Feb 9 '12 at 21:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.