From owner-freebsd-questions@FreeBSD.ORG Sun May 5 10:24:48 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 43D6D937 for ; Sun, 5 May 2013 10:24:48 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from smtp.infracaninophile.co.uk (smtp6.infracaninophile.co.uk [IPv6:2001:8b0:151:1:3cd3:cd67:fafa:3d78]) by mx1.freebsd.org (Postfix) with ESMTP id CC6348C2 for ; Sun, 5 May 2013 10:24:47 +0000 (UTC) Received: from seedling.black-earth.co.uk (seedling.black-earth.co.uk [81.2.117.99]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.7/8.14.7) with ESMTP id r45AOaTS071425 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Sun, 5 May 2013 11:24:36 +0100 (BST) (envelope-from matthew@FreeBSD.org) DKIM-Filter: OpenDKIM Filter v2.8.2 smtp.infracaninophile.co.uk r45AOaTS071425 Authentication-Results: smtp.infracaninophile.co.uk/r45AOaTS071425; dkim=none reason="no signature"; dkim-adsp=none (unprotected policy) Message-ID: <5186335E.30109@FreeBSD.org> Date: Sun, 05 May 2013 11:24:30 +0100 From: Matthew Seaman User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: Re: pwd.db/spwd.db file corupption when having unsafe system poweroff References: <20130417173544.25266cd6.freebsd@edvax.de> <20130501110147.c69f408b.freebsd@edvax.de> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2GFEFIBGBIOXVBXLUDLXK" X-Virus-Scanned: clamav-milter 0.97.8 at lucid-nonsense.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lucid-nonsense.infracaninophile.co.uk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2013 10:24:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2GFEFIBGBIOXVBXLUDLXK Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/05/2013 07:12, takCoder wrote: >> > Furthermore, file system corruption due to an abrupt >> > cut of power should be avoided. Whenever the system comes >> > up in a non-clean state, fsck should be run first, _then_ >> > the boot process should continue. Still it's possible that >> > this process leaves truncated files behind (e. g. the >> > binary database files with a length of zero, which implies >> > they will have to be rebuilt by pwd_mkdb). > i added fsck_background=3Dno to rc.conf but i still see the error.. and= i > don't see any differance in system startup output! how should i know it= 's > working?? You won't see any difference if things are all running smoothly -- that's because fsck is only required in the case of an unclean shutdown. and that simply won't happen at all for an ordinary system reboot. The main difference you'ld see with fsck_background=3Dno is that the system will take longer to come on-line after a crash. Depending on the size of your filesystems and how much you have stored in them, it can be very much longer: I've seen filesystems take hours to run a fsck. That's why background fsck exists -- it's better in many cases for a machine to be up and running and productive again quickly, even at the slight risk of problems due to filesystem corruption during the crash. With techniques like soft updates, which ensures file system meta-data consistency, the risks of such corruption are very much lower than without. Journalling effectively extends the same guarantee to data as well as to meta-data. And then there's the ZFS approach, where the copy-on-write semantics means that what is on disk is always coherent, although an unclean shutdown can lose the last few uncommitted changes. All in all, however you manage your disks the problem remains that in an unclean shutdown, filesystem changes in progress at the time of the crash will be lost. The best thing you can do to preserve your data is to minimize the chances of unclean shutdown. Which could be as expensive as installing UPSes everywhere, or as cheap as re-educating your users that pulling the plug or pressing and holding the power button is a "bad thing(tm)."[*] Cheers, Matthew [*] Some might suggest that this re-education is best achieved by a form of Pavlovian conditioning using severe negative reinforcement involving blunt force trauma. --=20 Dr Matthew J Seaman MA, D.Phil. PGP: http://www.infracaninophile.co.uk/pgpkey ------enig2GFEFIBGBIOXVBXLUDLXK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.16 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlGGM2QACgkQ8Mjk52CukIziBwCaA6TOPJAfUUq+k0xerunaNxQr m6EAoJNXgVK6sq3WGUZeaQoQIDziWnPM =cK15 -----END PGP SIGNATURE----- ------enig2GFEFIBGBIOXVBXLUDLXK--