checkfs script - something i noticed (forcing fsck)

J.A. Neitzel jan.listbox at belvento.org
Tue Jul 11 18:18:19 PDT 2000


Hi,

Has anyone ever tried to `shutdown -rF now` -or- `shutdown -hF now`,
where the "-F" is supposed to "Force fsck on reboot", and noticed
that the force fsck does not happen the next time you boot?

Well, I stumbled across this and fixed it. The script uses
"/forcecheck" where it should instead use "/forcefsck" ... Also of
note, "rm /forcefsck" may not work since filesystem is mounted ro at
that point. You can move the "rm /forcefsck" to somewhere else and do
it when it's mounted rw.

I put the "rm /forcefsck" -and- "rm /fastboot" in the mountfs script
instead... Like so:
rm -f /etc/mtab /etc/mtab~ /etc/nologin /fastboot /forcefsck

If interested, see my changes below and cut and paste as you wish:

------ begin ------
#!/bin/sh
# Begin /etc/rc.d/init.d/checkfs
# -- modified by J.A. Neitzel on 2000-07-10 --

.. /etc/rc.d/init.d/functions

echo -n "Activating swap..."
/sbin/swapon -a
evaluate_retval

if [ -f /fastboot ]
then
	echo "/fastboot exists, no file system check"
else
	/bin/mount -n -o remount,ro /
	if [ $? = 0 ]
	then
		if [ -f /forcefsck ]
		then
			echo "/forcefsck exists, forcing file system check"
			force="-f"
			rm /forcefsck # this rm may not work since
				      # the filesystem is mounted ro
		else
			force=""
		fi

		echo "Checking file systems..."
		-- <snipped here> --
# continue the rest of the script as it is in the book.
------ end ------

--
Regards,
J.A. Neitzel
jan at belvento.org
--
Mail archive: http://www.pcrdallas.com/mail-archives/lfs-discuss
IRC access: server: irc.linuxfromscratch.org port: 6667 channel: #LFS
Unsubscribe: email lfs-discuss-request at linuxfromscratch.org and put
"unsubscribe" (without the quotation marks) in the body of the message
(no subject is required)



More information about the lfs-dev mailing list