Additional features for /etc/rc.d/fsck

From: Alex Keda <admin_at_lissyara.su>
Date: Sun, 15 Nov 2009 14:58:02 +0300
hi!
I have many servers with using gjournal.
Sometimes, after unexpected reboot, booting OK, but, filesystem have 
error. If I run fsck -y manually - all OK.
But, for some servers I do not have physical access, and check '/' and 
some another filesystems - impossible.
I modify /etc/rc.d/fsck, and add 2 new options to rc.conf
HP$ grep fsck /etc/rc.conf
force_fsck="YES"
force_fsck_list="/"
HP$

It's required background_fsck="NO" in rc.conf

May be include it in source three? Very useful.

--- /root/fsck	2009-11-15 14:13:25.000000000 +0300
+++ /etc/rc.d/fsck	2009-11-15 14:42:32.000000000 +0300
_at__at_ -27,7 +27,16 @@
 		if checkyesno background_fsck; then
 			fsck -F -p
 		else
-			fsck -p
+			if checkyesno force_fsck; then
+				echo "Force fsck enabled"
+				for filesystem in ${force_fsck_list}
+				do
+					echo "Force check $filesystem"
+					fsck -y $filesystem
+				done
+			else
+				fsck -p
+			fi
 		fi
 
 		case $? in
Received on Sun Nov 15 2009 - 10:58:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:58 UTC