• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Why does the filesystem get messed up so easily on hard reboots in linux?

ThaGrandCow

Diamond Member
I've heard so many horror stories and seen people mess up their linux boxes by doing one hard shutdown and restart. It seems in windows this isn't really much of a problem, but in linux you might get lucky the first time and the second time you have some major damage. Is there a way to prevent this from messing up so much?
 
yeah ext2 is really finicky about having the power cut, simple solution is to upgrade to ext3.

tune2fs -j /dev/hdXX
tune2fs -i 0 -c 0 /dev/hdXX

change /etc/fstab ext2 entries to ext3

remount or just wait till the next time you boot, and you're good to go.

(you also must have ext3 support in your kernel for this to work, but if not, no harm done, it will default to ext2 and not be a problem 🙂)
 


<< yeah ext2 is really finicky about having the power cut, simple solution is to upgrade to ext3.

tune2fs -j /dev/hdXX
tune2fs -i 0 -c 0 /dev/hdXX

change /etc/fstab ext2 entries to ext3

remount or just wait till the next time you boot, and you're good to go.

(you also must have ext3 support in your kernel for this to work, but if not, no harm done, it will default to ext2 and not be a problem 🙂)
>>


Just type those 2 lines into the CLI and change ext2 to ext3 in those files? Thats it?
Note: I = linux n00b (not stupid, just n00b)
 
yeah, make sure your kernel has ext3 support. ext3 is basically just ext2 with a journal file (/.journal) tacked on. it can still be mounted as ext2 and everything, so its totally compatible with ext2.

the first command writes the journal file, the second command disables automatic fsck's, since you really dont need them with ext3, although you may want to do them manually every once in a while just for the hell of it.

but dont take my word for it, go read up 😀
 
I've heard so many horror stories and seen people mess up their linux boxes by doing one hard shutdown and restart. It seems in windows this isn't really much of a problem, but in linux you might get lucky the first time and the second time you have some major damage. Is there a way to prevent this from messing up so much?

Linux caches a lot of the filesystem, infact it will use all the available memory for that, and in the case of ext2 a lot of the organizational information (superblock, file metadata, etc) is cached and is lost when the power is cut.

yeah, make sure your kernel has ext3 support. ext3 is basically just ext2 with a journal file (/.journal) tacked on. it can still be mounted as ext2 and everything, so its totally compatible with ext2.

Recently the .journal file is a hidden inode, unless you tune2fs on a mounted filesystem because it can't hide it then.

Also be carefull, if you're e2fsprogs aren't new enough they won't work on ext3 because they'll see the unsupported filesytem features (has_journal, and possible needs_recovery) in the superblock and will bail since they don't understand them.

Overall ext3 should save you from losing your whole filesystem if you pull the power, but it won't save your data. If you had a file open in something when you did it, expect the file to be trashed and be happy if it's not =)
 


<< yeah, make sure your kernel has ext3 support. ext3 is basically just ext2 with a journal file (/.journal) tacked on. it can still be mounted as ext2 and everything, so its totally compatible with ext2.

the first command writes the journal file, the second command disables automatic fsck's, since you really dont need them with ext3, although you may want to do them manually every once in a while just for the hell of it.

but dont take my word for it, go read up 😀
>>


Is ext3 support installed by default in redhat 7.2, or do I have to go download it?
Can I assume fsck is like a windows scandisk?
 
Is ext3 support installed by default in redhat 7.2, or do I have to go download it?
Can I assume fsck is like a windows scandisk?


Yes and Yes.
 


<< Linux caches a lot of the filesystem, infact it will use all the available memory for that, and in the case of ext2 a lot of the organizational information (superblock, file metadata, etc) is cached and is lost when the power is cut. >>


Ahhh that explains why in the other thread the guy was wondering why his memory was at 90% usage all the time.

EDIT:


<< Is ext3 support installed by default in redhat 7.2, or do I have to go download it?
Can I assume fsck is like a windows scandisk?


Yes and Yes.
>>


<steeple fingers like Mr. Burns>
Eeeeeeexxxxxxxxxxcelent 😀
 
Back
Top