General strategies to deal with hard disk corruption after PC crash in Linux
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.
General strategies to deal with hard disk corruption after PC crash in Linux
One thing that annoys me with linux, is if ever my computer crashes, I can never (in any distro) recover and always have to reinstall because of a corrupt journal. Am I using the wrong file system? (ext3).
You aren't using the "wrong" file system exactly. EXT3 does have a journal. But perhaps you aren't using the best file system for the job, no.
I have always used ReiserFS on my machines, and have been able to recover at least partially from any sort of system failure I have had in the past. I have even managed to recover most of my documents from a HDD that got scrambled from a crazy IDE controller.
Since using ReiserFS I have never had problems with the file systems being corrupted just from being shut down improperly, which I can't say for EXT2 or EXT3.
It's so damn annoying I love linux, but I haven't got enough know how to babysit corrupted harddrives because it just hates crashes. I also can't recommend it to clients yet either for the same reason! Do people recommend not using ext3, why is it default for installs? After a simple crash, with a new hard drive, it just hangs on boot. fsck says bad block or something, and presumably can't fix it withoug my help. (I've since formatted anyway).
It's crazy, unless I'm missing something obvious (other than use a more reliable fs).
EXT3 is used as the default for many distributions simply because it is the "standard". It has been around for a long time, it is supported by almost anything, and it is simple. It is also very reliable, assuming nothing goes wrong, like the file system being unmounted properly, a bad HDD, etc.
More exotic file systems, like ReiserFS or XFS, are newer technologies and require specific configuration and management software. Even so, a number of distributions now offer ReiserFS as one of the choices on install, though I don't think any of them actually use it as the default yet.
By "crash" I assume you are meaning the system has frozen to the point it has to be powered off without being properly shutdown.
In this case, the problem is that the file systems will not be unmounted properly, leading to possible corruption. The system will attempt to check and repair the file systems once it has restarted and realized what happened, but as you have seen, that does not always go well.
More exotic file systems, like ReiserFS or XFS, are newer technologies and require specific configuration and management software. Even so, a number of distributions now offer ReiserFS as one of the choices on install, though I don't think any of them actually use it as the default yet.
@milescook
Lots of people, myself included, think Reiserfs is a junk filesystem and ext3 is one of most reliable filesystems. If your computer crashes alot then something is wrong. Just switching filesystems is unlikely to help.
I'm not saying MS3FGX is wrong. Just wanted to let you know there are different opinions on this matter.
Greatfuly recieved. So lets look at a common scenario for me:
I have just made a fresh install of linux, it's in the desktop, and I have a power cut. When it reboots, it won't pass the file system check. So after hours pouring over manuals for fsck, I try the recommended commands, fsck tells me to go fish.
On my other box, I would press CTRL+ALT+SYSREQ+E and the task would terminate, alowwing me to go to a shell. If then I ask the pc to reboot it reboots fine! (???), albeit with some hard disk corruption, and more and more services failing to start the more it happens.
So why can't ext3 just fix itself like ntfs, and let me get on with life?
Please note I mean all this in good humour, as I admire linux (installing Mandriva 2007 free now) and want to get to grips with this last annoying trait!
I have no experience with Mandriva. If computer is shut down partitions are umounted and this is written to the disk - it's called "dirty bit is unset". Now, if power is cut this bit is not unset signaling partition needs checking. Once this dirty bit is unset partition is not checked any more despite it may still have problems. All distros I have execute filesystem check/repair automatically when dirty bit is set. So normally "ext3 fixes itself". It's weird Mandriva seems not to do this. If you have often power cut you may try using the sync option in fstab, it should reduce risk of corruption.
Yes, but personally I do want Linux to be as easy as Windows, because the mass population deserve a better OS. If Linux stays the play toy of the techies, that won't happen.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.