Hard Disk failing!

Just when you think everything's running well..

My system is a Raspberry Pi with the rootfs moved to a external USB 1TB drive, and has run emoncms successfully for the past year, however last Saturday the whole lot ground to a halt, and I couldn't access the Pi via web or shell.

I checked the SD card and that seemed fine, but when I checked the USB HDD I found that it had 643 bad sectors.

Strangely, when I connected everything back together, it began working again, and is still working now, however when I tried to back up the volume using dd, it stopped after about 800mb reporting 'input/output error' (presumably struggling with the bad sectors).

Not sure where to go from here, but thought I'd raise it because it seems premature for a hdd to fail, is emoncms such heavy duty??

 

Paul

TrystanLea's picture

Re: Hard Disk failing!

Hello Paul, sounds like pretty much the same error I got! http://openenergymonitor.org/emon/node/5213

Did you have a powercut?, is your historical data intact?

Paul Reed's picture

Re: Hard Disk failing!

No powercut (as far as I'm aware), and all the emoncms data still appears intact.

Your script appears to only backup the databases, and does not include the rest of the system, wouldn't rsync copy the whole lot, or would the bad sectors also cause problems for rsync?

Did your HDD need replacing after you had backed up the databases?

 

Paul

TrystanLea's picture

Re: Hard Disk failing!

I didnt try rsync, just cp but I assume it would have had the same problem with rsync, it was if it couldnt read from one 4 byte datapoint in the datafile. It would copy data upto say 20% through the file quite fast then fail to copy the next datapoint and normally exit with an io error. But by creating a script which would skip to the next dp when it got stuck it seems to be able to continue ok and recover the rest of the file.

I changed the data location for the recovered data from /var/lib/phpfina etc to /home/pi/Data leaving the original data in place and am using the same harddrive.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.