Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.