Operating System - Linux
1828404 Members
3446 Online
109977 Solutions
New Discussion

Having to e2fsck manually

 
SOLVED
Go to solution
K.C. Chan
Trusted Contributor

Having to e2fsck manually

All,
I am sure on some occasion you have experience a hard-reboot. Sometimes a hard re-boot requires manual intervention with e2fsck. How does one properly do this w/o risking corrution when the file system you need to do this on is root and it's mounted? e.g: When I get this prompt "crontrol D to reboot or enter root's password for maintanence", I usually enterl root's password and clean the root filesystme with "/sbin/e2fsck -y -b 32768 /dev/hda2". Is this way to do it? or is there a better of doing this w/o risking file system corruption? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
1 REPLY 1
Bill Thorsteinson
Honored Contributor
Solution

Re: Having to e2fsck manually

There is little risk of corrupting the file system
by running e2fsck. However it can delete or truncate files
where the file system information is incomplete.

I would drop the switches and
run 'e2fsck /dev/hda2'. This
will use the default superblock and prompt you
before any changes. Add the
-b 32768 switch if the
superblock can't be found.

The effects of e2fsck I have
encountered are:
- log files truncated in the middle of a record.
- files being created during shutdown removed.
- files without a directory entry removed.