Sometimes, if my target watchdogs and does not shut down cleanly, the next
time it boots, there is a "stale file handle".  If I run fsck manually, it
finds and fixes the problem.

My problem is: fsck is not being run at boot time on my partitions in
/etc/fstab.

Example partition in /etc/fstab:
/dev/sda2 /hd/app ext2 rw,errors=continue 0 2 <- Shouldn't this '2' cause
fsck to be run on this partition?


I always get the following message at boot time, even when the partition is
"not clean":

Mounting filesystems
[   13.693640] EXT2-fs warning: mounting unchecked fs, running e2fsck is
recommended


It looks like the script: /etc/rc.d/init.d/filesystems is handling the
mounting.

Can anyone tell me how to get fsck to be run automatically at boot time?

Sorry if this is a little off LTIB topic.

Thanks!
Todd


Particulars:
ltib 10.1.1 ($Revision: 1.68 $)
Host: Ubuntu 10.04 LTS
Target: PPC5200B
#!/bin/sh

if [ "$1" = "stop" ]
then
    echo Unmounting filesystems
    umount -a -r
    mount -o remount -r %root% /
    [ -x /sbin/swapoff ] && swapoff -a
fi

if [ "$1" = "start" ]
then
    echo Mounting filesystems
    if [ "$TMPFS" = "tmpfs" ]
    then
        mount -n -t $TMPFS shm /dev/shm
    fi
    if [ -n "$TMPFS" ]
    then
        mount -n -t $TMPFS rwfs /mnt/rwfs -o size=$TMPFS_SIZE
    fi
    if [ "$READONLY_FS" != "y" ]
    then
        mount -n -o remount -w %root% /
        NFSBOOT="`cat /proc/cmdline | grep -q /dev/nfs ; echo $?`"
        if [ "$NFSBOOT" == "0"  -a  -n "$RAMDIRS" ]
        then
            echo "Booted NFS, not relocating: $RAMDIRS"
            RAMDIRS=""
        fi
    else
        # initramfs, ramdisks, others? come up read/write by default
        mount -n -o remount -r %root% /
        RAMDIRS="$RAMDIRS /tmp /etc /var"
    fi
    if [ -n "$RAMDIRS" ]
    then
        for i in $RAMDIRS
        do
            if [ ! -e /mnt/rwfs/$i ]
            then
                cp -a $i /mnt/rwfs/
                mount -n -o bind /mnt/rwfs/$i $i
            fi
        done
    fi
    if [ -e /etc/mtab ]
    then
        rm -f /etc/mtab
    fi
    ln -s /proc/mounts /etc/mtab
    if [ ! -d /dev/pts ]
    then
        mkdir /dev/pts
    fi
    mount -a
fi
_______________________________________________
LTIB home page: http://ltib.org

Ltib mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/ltib

Reply via email to