From owner-freebsd-questions@FreeBSD.ORG Sat Dec 8 19:48:04 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DF2516A417 for ; Sat, 8 Dec 2007 19:48:04 +0000 (UTC) (envelope-from bds@waywood.co.uk) Received: from lon-mail-1.gradwell.net (lon-mail-1.gradwell.net [193.111.201.125]) by mx1.freebsd.org (Postfix) with ESMTP id 93AF413C465 for ; Sat, 8 Dec 2007 19:48:03 +0000 (UTC) (envelope-from bds@waywood.co.uk) Received: from 85-211-82-64.dyn.gotadsl.co.uk ([85.211.82.64] helo=[192.168.1.6] country=GB ident=bds*pop3&waywood^co$uk) by lon-mail-1.gradwell.net with esmtpa (Gradwell gwh-smtpd 1.264) id 475af4f2.15294.2446; Sat, 8 Dec 2007 19:48:02 +0000 (envelope-sender ) Message-ID: <475AF4EB.4090208@waywood.co.uk> Date: Sat, 08 Dec 2007 19:47:55 +0000 From: Barnaby Scott User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Peter Schuller References: <4758180C.4060208@livedatagroup.com> <4758266E.6040704@livedatagroup.com> <2784.85.211.82.64.1196976328.squirrel@www.gradwell.com> <200712080736.50433.peter.schuller@infidyne.com> In-Reply-To: <200712080736.50433.peter.schuller@infidyne.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Randy Ramsdell , freebsd-questions@freebsd.org Subject: Re: Freebsd filesystem ( hard reboot ) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Dec 2007 19:48:04 -0000 Peter Schuller wrote: >> My understanding from the reading I have done is that in a situation like >> this where power outages are a danger (and presuably having the UPS signal >> the server to shut down gracefully is not practical), you need to make the >> file system as robust as possible in the first place, rather than rely on >> fsck -y after the event. Doesn't fsck -y rather sweep potential problems >> under the carpet? > > fsck is not sweeping potential problems under the carpet, as long as nothing > unexpected goes wrong (software bug, hardware problem). > > The reason fsck works to begin with, is that it is designed to fix specific > inconsistencies in the file system that are expected. The file system > (takling about UFS here, and other non-journaled file systems that care about > this stuff) is designed very carefully such that certain correctable > inconsistencies happen, while preventing those that are not correctable. > > That is, under fully expected circumstances, UFS is intended to require fsck > on reboot. But it is NOT intended that fsck find unexpected inconcistencies > and ask for operator intervention. Exactly, which is why I thought that just bypassing all those interventions with -y was 'brushing under the carpet'. No? > > What happens in the event of write caching + power failure, software bug or > hardware bugs, is that you end up with semi-random inconsistencies. fsck > *may* be able to patch the situation enough for the file system to be usable, > but fundamentally all bets are off. > >> First step surely is to *disable* write caching if you have drives that >> are doing it? > > For UFS/reiserfs/xfs/jfs/ext3fs/ext2fs, yes. > >> Then consider mounting the file system synchronously. Mind you, I don't >> know what the scale of the performance loss would be, and whether anyone >> does this nowadays! > > Synchronous mounting is not required for consistency (except perhaps for > ext2fs; not sure). It is enough that the system does not break the file > system's ability to guarantee ordering of certain critical operations, which > is why write caching causes a problem (the drive re-orders writes for > performance and you end up with B happening before A, but consistency > depended on B happening AFTER A). I realise it would normally be excessively cautious to go for synchronous mounting, but what about for environments where power supply is such a major problem?