[mythtv-users] Hard drive failure -- recovery method suggestions

Simon Hobson linux at thehobsons.co.uk
Fri Apr 17 10:16:37 UTC 2015


Jerry <mythtv at hambone.e4ward.com> wrote:

> I am currently out of town, so I don't know too many details.  My 3 TB Seagate drive had a few bad sectors on one day, and then about 12 hours later, the drive was mounted as read-only.  It is my only media hard drive.
> 
> The first thing I did was to reboot the machine, which I know was a mistake, but I had not had much sleep.  The machine seems to be stuck in the boot process, probably at a system maintenance prompt, as I can no longer access it remotely.

It may well be at a BIOS prompt telling you that hard drive failure is imminent.

> My question is, what tools are recommended for recovery?

My favourite recovery tool for drives with bad sectors is ddrescue (not to be confused with dd_rescue !) which is designed specifically for this. Use a log file so it can be stopped and restarted if necessary. If have a session running now - boot from a USB stick "live disk" (Debian), use the spare space on the stick for a small partition, mount that and put the log file on it.

Of course, if you can boot your OS from another disk then that makes things easier !

You do need a destination drive which is no smaller (not even one sector) smaller than the source. But at the end you have a copy of every sector that is readable. Only when the process is finished, use the OS tools to (optionally) repair the filesystem and then copy the files off it. So that means having a spare 3TB drive, and enough space to copy the media files off it.

If there aren't too many bad sectors, then filesystem repair should fix (using redundant information) any errors in the directory structures etc. For media files, any bad blocks should just cause a short dropout on playback.

The downside to ddrescue is that if the drive is big, without a lot of data on it, then it's inefficient as it recovers a lot of empty space. But I don't know of any tool that does a similar sort of process on individual files.

While it's working, "ddrescuelog -t <logfile>" will give you a summary of how it's going. Just be aware that the more bad blocks there are, the longer it can take - the last one I did was a 320G laptop drive (not mine) that took 3 weeks (it had a lot of bad blocks !), but there were important files on there without any backups.



More information about the mythtv-users mailing list