[CentOS] General Linux query

Thu Aug 21 11:38:22 UTC 2008
Warren Young <warren at etr-usa.com>

lingu wrote:
> 1) How file systeem get corrupted on linux?

The same way any file system gets corrupted: data gets damaged or lost 
on its way to the physical media.

> 2)  why,when and how fsck to be run without lossing data?

The purpose of fsck is to bring the file system back into a consistent 
state so you can continue to use it, not to guarantee to recover your 
data.  If you need guaranteed data recovery, ship the drive to a data 
recovery house.

> 3)  Is there is any other tool  other than fsck available for file 
> system check

I'm not aware of any.  There may be other tools that incorporate fsck 
functionality, but nothing that's designed to do a better job, somehow.

> 4)  what are all the precaution to be made to prevent file system 
> corruption.

1. Put the computer on a UPS.

2. Configure nut (http://networkupstools.org/) to bring the system down 
safely well before the UPS's battery quits.  You don't want to 
fully-discharge a lead-acid battery, which is what UPSes use.  Shut down 
before it drops below about 20%.

3. Use some form of redundant RAID.  (Not RAID-0!)

4. Run the RAID system's consistency check function periodically.

5. If the system's RAID card offers a battery backup option, get one.

6. If the system is experiencing kernel panics, fix the problem that's 
causing it.  Kernel panics are almost always due to broken hardware. 
Replace the broken hardware.  Very rarely, they may be due to a bad 
driver or a kernel bug, but when you hear hoof beats, think horses, not 

7. Back up your system.


9. BACK! UP! YOUR! SYSTEM!!!  (And then, back it up again.)

> 5)  why & when the system will get hanged  and what are all the possible 
> reasons?

There are an infinite number of answers to this question.

You can configure Linux to dump the kernel's memory state and other 
debugging information to disk in case of a crash.  Do that, and convince 
someone to analyze the information for you.

P.S. Don't you think you could have thought up a better title for this 
thread?  Even "fsck" would have been better.