Date: Fri, 13 Dec 2013 18:20:01 +0400 From: Antonio Kless <antoniok.spb@gmail.com> To: freebsd-questions@freebsd.org Subject: Avoid to run `fsck` twice (and save some time during boot) Message-ID: <52AB1791.6090508@gmail.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
I am running 8.4-RELEASE-p4 (amd64) box with this lines in /etc/rc.conf:
fsck_y_enable="YES"
background_fsck="NO"
- to be sure that if it will be rebooted with power loss, filesystem
would be checked and repaired.
But I discovered (/etc/rc.d/fsck) that `fsck` run twice:
fsck_start()
{
if [ "$autoboot" = no ]; then
echo "Fast boot: skipping disk checks."
elif [ ! -r /etc/fstab ]; then
echo "Warning! No /etc/fstab: skipping disk checks."
elif [ "$autoboot" = yes ]; then
# During fsck ignore SIGQUIT
trap : 3
check_startmsgs && echo "Starting file system checks:"
if checkyesno background_fsck; then
fsck -F -p
else
fsck -p
fi
case $? in
.....
8)
if checkyesno fsck_y_enable; then
echo "File system preen failed, trying fsck -y ${fsck_y_flags}"
fsck -y ${fsck_y_flags}
case $? in
0)
;;
*)
echo "Automatic file system check failed; help!"
stop_boot
;;
esac
else
echo "Automatic file system check failed; help!"
stop_boot
fi
;;
.....
So time is wasting. Why not just run `fsck -y ${fsck_y_flags}`?
Of course I could hack the script, but I wonder if there is the way to
avoid runnig fsck twice not hacking system scripts? Or is there any
reasons to run it twice?
--
Best regards,
Antonio Kless
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAEBAgAGBQJSqxebAAoJEJA+Ljxn+ybKSgAP/RPQaZ39AjzqK7LlN3teN383
YKJWwAVJi7S74UG4g9isGqjmO4pBYN9ek7F+ZBtpoDIE8iAUdLQQ095ibHnIacvI
0MYpb2C/DeB4CSVpI8c8NlK1FL4BRWfpQiFjWFA0vfruDfNpQYFYpAVbKbpRRNct
nlfR4ptPi8+tdlcV1wPwOaTizKd/NHEftN26sAo2F0VhCCzQqolPx8aMB6Rjvlk+
0E/AeQab5jiKlcvdfcKX/f/XFiBHx/0zlhus2IeS+w88U6pIxCE6/3JStMfjKiOe
Z9/bTlCD3s9L1xKk843KiLnrAkUdlyVncDooxbkm3Gb1qVvde3jSOB7O/c9joFfg
Hhg1suo/W67aMqy6oZ+LQyeJKQhs1m74tHFpUQGFzspKgy8AQ5ChHwJVethPQWVp
ua+v1cy+ZZ9PePD2m4dmGkuPcaFTs0oZKcgV+v9aDv9aaovka789VlFQbrneysKg
YDBNXQXZ7eoc2Glq6VpsrZuvizFCTJJOpcIDj9iw6K5G4thHnhPbx3vRvlzFEtdL
UscGcqvHVev/k7htmnJLv3i/E9ZNQfox789JxRX3WKtdBIBvyUGe7Pig4CtYtfIP
RGa0872woFvCQyr9RyzPquEVMEPlLFhIVX/mpFmyyt3PjMTMGhVEz0WQyGjcB9hZ
/dbtIflWb6pqoo0hbz8Y
=foQZ
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52AB1791.6090508>
