LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Bad sectors and RAID (https://www.linuxquestions.org/questions/linux-general-1/bad-sectors-and-raid-492816/)

comrade_bronski 10-16-2006 07:27 AM

Bad sectors and RAID
 
Over the last year I've had two maor events with my hard drive. Twice now I've booted my Debian system up to be told that I need to manually run fsck to repair the hard drive. The first time I did this, it would appear that INETD was damaged. I lost my sshd, I had to manually start the xserver as well as apache2. This was not so bad and the thought of having to reinstall everything didn't appeal, however I could not repair these daemons, I tried reinstalling them all, but this made no difference...? The first question is how can I recover this lost functionality?

I have since had a second attack of bad sectors with has now completely knocked out the Xserver so I can no longer use my desktop - I'm limited to command line. I've therefore decided to go back and reinstall everything, which takes a significant amount of time. Never mind. However this does seem somewhat crazy - that I can't somehow reinstall or repair the damaged software...!

As a result, I've decided to use two drives in a RAID array. This got me thinking - will this help? Say for example I end up with bad sectors on one drive. I'm forced to manually run fsck and it ends up deleting some damaged files. What is the action of the RAID software? Should I in fact just pull the faulty drive out and replace it, or should I attempt to repair it using fsck?

This has happened to me know twice in one year so I love to figure out how to create a more robust and reliable system that doesn't require a complete reinstall twice a year because of physical issues on the hard drive.

Thanks in advance for your help!

jlewisfl 10-16-2006 08:29 AM

bad sectors, raid
 
As a stopgap, assuming that one or more sectors of the file are bad, don't delete the bad file. Instead, change the filename to something like badsector1, make it read-only, then install a new copy of the desired file. That traps the bad sector within a file that you no longer need or use. If the drive has developed one or more bad sectors, it likely will develop more, so I would replace the drive as soon as possible. Note that if the drive gets defragmented in the meantime, you may have that bad sector show up in a different file. If you are using a striped raid, for higher i/o bandwidth, I would consider whether you really need the higher bandwidth, as I would personally rather operate in raid-mirror mode, where the drives operate as a real-time backup for each other. In that mode, if a sector fails on one drive, or a whole drive fails catastrophically, you don't lose any data, you simply replace the failed/failing drive while the mirror drive provides uninterrupted access to everything.


All times are GMT -5. The time now is 02:11 PM.