Skip site navigation (1)Skip section navigation (2)
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
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--JqldelAwgxgAjJLlqVr0UD5tm68CoRjMT
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I am running 8.4-RELEASE-p4 (amd64) box with this lines in /etc/rc.conf:

fsck_y_enable=3D"YES"=20
background_fsck=3D"NO"=20

- 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" =3D no ]; then
        echo "Fast boot: skipping disk checks."=20
    elif [ ! -r /etc/fstab ]; then
        echo "Warning! No /etc/fstab: skipping disk checks."=20
    elif [ "$autoboot" =3D yes ]; then
                    # During fsck ignore SIGQUIT
        trap : 3

        check_startmsgs && echo "Starting file system checks:"=20
        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_f=
lags}"=20
                fsck -y ${fsck_y_flags}
                case $? in
                0)
                    ;;
                *)
                echo "Automatic file system check failed; help!"=20
                    stop_boot
                    ;;
                esac
            else
                echo "Automatic file system check failed; help!"=20
                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?

--=20
Best regards,
Antonio Kless



--JqldelAwgxgAjJLlqVr0UD5tm68CoRjMT
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----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-----

--JqldelAwgxgAjJLlqVr0UD5tm68CoRjMT--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52AB1791.6090508>