From owner-freebsd-questions@FreeBSD.ORG Fri Dec 13 14:20:14 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 05045652 for ; Fri, 13 Dec 2013 14:20:14 +0000 (UTC) Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CFEE1CCE for ; Fri, 13 Dec 2013 14:20:13 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id eo20so1426306lab.0 for ; Fri, 13 Dec 2013 06:20:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; bh=sph2kqGfoUxaxTloBS5emapGAb7NO/VtW5KJ97eRcbI=; b=UjRHlyz5+WHNKC/UpKpv8lJws48zlQwPqBjc2XXVO/EcjAQQnVNklSA+/O+FfRLfRf +xASPZXYPMHfMI08TngnoO/lzNHQc06SMDRRK9iAsMuEs6MowTLjD0wHK691IUHDHSIn TYHMXf5O2CurW2ZYocjN+HZsnb2UA4BS3drbzHXYw0rYJju15rC1dueARzjCgcwvCe8h iUkk1yKlGphNX8JDCIj1HYpjuEFxzP3ujgOkRpKpfwIl3ENja2OnfBsBTjZFwkNfDzNv zbJEgdg4MJn0pLgC9oFs6A4lTs+vJdTuvgXj9K2lfK8n/Ow3hz6itFIZvqXVHqHfx1S2 Hp6g== X-Received: by 10.152.29.130 with SMTP id k2mr94039lah.84.1386944411167; Fri, 13 Dec 2013 06:20:11 -0800 (PST) Received: from [10.10.10.223] ([78.140.198.50]) by mx.google.com with ESMTPSA id ld10sm4595483lab.8.2013.12.13.06.20.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Dec 2013 06:20:10 -0800 (PST) Message-ID: <52AB1791.6090508@gmail.com> Date: Fri, 13 Dec 2013 18:20:01 +0400 From: Antonio Kless User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Avoid to run `fsck` twice (and save some time during boot) X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JqldelAwgxgAjJLlqVr0UD5tm68CoRjMT" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2013 14:20:14 -0000 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--