Jump to content

Unclean shutdown, file system integrity check on startup


coverup
 Share

Recommended Posts

I turned off the computer before the filesystems were cleanly unmounted. Next time I turned it on, I was asked to press Y in order to force the filesystem check, but I was not quick enough - in previous versions the filesystem check was forced without my intervention. I reboot a few more times, it never asks me again to perform the check. Running

e2fsck -fn /dev/hda1

shows a whole bunch of problems:

Warning!  /dev/hda1 is mounted.

Warning: skipping journal recovery because doing a read-only filesystem check. Pass 1: Checking inodes, blocks, and sizes

Deleted inode 33990 has zero dtime.  Fix? no



Inodes that were part of a corrupted orphan linked list found.  Fix? no



Inode 33991 was part of the orphaned inode list.  IGNORED.

Inode 33992 was part of the orphaned inode list.  IGNORED.

Inode 33993 was part of the orphaned inode list.  IGNORED.

Inode 33995 was part of the orphaned inode list.  IGNORED.

Inode 33996 was part of the orphaned inode list.  IGNORED.

Inode 111147 was part of the orphaned inode list.  IGNORED.

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 4: Checking reference counts

Inode 2 ref count is 20, should be 21.  Fix? no



Pass 5: Checking group summary information

Block bitmap differences:  -70197 -230746

Fix? no



Inode bitmap differences:  -(33990--33993) -(33995--33996) -111147

Fix? no



Directories count wrong for group #7 (116, counted=115).

Fix? no





/dev/hda1: ********** WARNING: Filesystem still has errors **********



/dev/hda1: 20088/141696 files (0.5% non-contiguous), 40985/283137 blocks

To be safe and avoid hand mounting/unmounting partitions, I would like to run the file system integrity check automatically, everytime after the filesystem was not properly shutdown. How do I do that?

 

Thanks for your help...

Link to comment
Share on other sites

You should not do that. You should say "no" to fsck and let the journal recover your file system. Running ext3 and letting fsck repair a mounted file system will more than likely hose it. I've heard more than one horror story......

 

/germ

Link to comment
Share on other sites

Well, that may be how it's supposed to work. The filesystem obviously had errors despite I didn't answer anything to the prompt and let the journal to recover...

 

By the way, to force filesystem check you need to create an empty file /forcefsck

[root@localhost homedir]# touch /forcefsck

then restart. The file will be deleted afterwards. Also, the script /etc/sysconfig/autofsck sets timeout and automatic fsck. I think, it is activated only if /.autofsck exists.[/i][/code]

Link to comment
Share on other sites

I would boot the mandrake CD in rescue mode and do a complete filesystem check from there. Better yet, get Knoppix, boot it, and fix it from there.

 

You'll probably want to check the man pages for the file check program related to the filesystem you're using. I had to fix the reiserfs filesystem on my server twice. I had to use advanced options to get it to rebuild directories and things. There is a lot more to fix on these journaling filesystems than the straight forward ext2 partitions.

 

Good luck,

 

Glitz.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...