[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

assurance that / is read-only before fsck



Slackware 1.1.1 tried in a half-ass way to assure that the root directory
was mounted read-only before it fscked it.  Debian doesn't even do that.
I think it would be a good idea, but it can't be done by using 'rdev' on
some random kernel image.

Here's what I have in my rc.S now:

# Check the integrity of all filesystems (if not a fastboot)
if [ ! -e /etc/fastboot ]; then

        # ensure that root is quiescent and read-only.
        mount -n -o remount,ro /

        if [ $? = 0 ]; then
                echo "Checking filesystems..."
		...check them...
        else
                echo "ERROR: cannot fsck because root is not read-only!"
        fi
else
        echo ""
        echo "*** Filesystems are not being checked! ***"
fi


This obviously isn't perfect, but it at least tries to force the root
directory to be read-only, and it's much less error prone than any
other mothod I've seen.  At one point I had the script checking root's
writability by echoing to a reserved file in /etc, but that's ugly,
and the above solution will correct an improperly installed kernel.

Those of us who use LILO won't benefit much from this change, but
bootlin and bootdisk users will, and we can all rest a little easier
knowing Debian is that much more robust.




Reply to: