From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.6) Gecko/20050225 Firefox/1.0.1 Description of problem: Turing on "dir_index" filesytem option and proper initialization I've triggered a reboot cycling. Version-Release number of selected component (if applicable): initscripts-7.93.11.EL-1 How reproducible: Always Steps to Reproduce: 1. Set dir_index option: # tune2fs -O dir_index /dev/md0 # tune2fs -O dir_index /dev/md1 2. Set additional fschkoption: # echo "-D" > /fsckoptions 3. Force fsck next reboot # touch /forcefsck 4. Reboot # reboot Actual Results: Checking root filesystem [/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a -f -D /dev/md1 /: ***** REBOOT LINUX ***** /: 35135/513024 files (1.0% non-contiguous), 708617/1024112 blocks Unmounting file systems Automatic reboot in progress. Expected Results: Checking root filesystem [/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a -f /dev/md1 /: 35133/513024 files (1.0% non-contiguous), 708615/1024112 blocks [ OK ] Additional info: During debugging I found that the problem is located in rc.sysinit. rc of fsck is in case of using "-D" 3, which causes the reboot: elif [ "$rc" -eq "2" -o "$rc" -eq "3" ]; then <-!!!! echo $"Unmounting file systems" umount -a mount -n -o remount,ro / echo $"Automatic reboot in progress." reboot -f fi Checking root filesystem [/sbin/fsck.ext3 (1) -- /] fsck.ext3 -a -f -D /dev/md1 /: ***** REBOOT LINUX ***** /: 35135/513024 files (1.0% non-contiguous), 708617/1024112 blocks #DEBUG: exit code: 3 <----!!!!!!! Unmounting file systems Automatic reboot in progress. Looks like something needs to be reviewed here, because reboot cycling is not nice ;-)
Here an verbose execution of fsck: # fsck.ext3 -f -D /dev/md1; echo $? e2fsck 1.35 (28-Feb-2004) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 3A: Optimizing directories Pass 4: Checking reference counts Pass 5: Checking group summary information /: ***** FILE SYSTEM WAS MODIFIED ***** /: ***** REBOOT LINUX ***** /: 35138/513024 files (1.0% non-contiguous), 708739/1024112 blocks 3
It's a little bit strange, it looks like that using "-D" on the root partition results in rc=3, while using "-D" e.g. on the "/boot" partition results in rc=1: # fsck.ext3 -f -D /dev/md0; echo $? e2fsck 1.35 (28-Feb-2004) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 3A: Optimizing directories Pass 4: Checking reference counts Pass 5: Checking group summary information /boot: ***** FILE SYSTEM WAS MODIFIED ***** /boot: 59/26104 files (16.9% non-contiguous), 30629/104320 blocks 1
EXIT CODE The exit code returned by e2fsck is the sum of the following condi- tions: 0 - No errors 1 - File system errors corrected 2 - File system errors corrected, system should be rebooted initscripts is just following orders.
The "-D" flag forces the htree information on-disk to be rebuilt unconditionally. That *always* modifies the filesystem. That *always* causes e2fsck to return non-zero. That will *always* require a reboot if you do it to the root filesystem. In short, everything is working just as you'd expect if you add options to /fsckoptions which require compulsory changes to the root filesystem. The answer is not to do this. :) To do this manually, I'd boot either to a rescue CD or to a readonly root mount (eg. boot with init=/bin/sh),force the fsck -D from there, and then reboot.