From owner-freebsd-questions@FreeBSD.ORG Thu Dec 23 18:56:54 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4116316A4CE for ; Thu, 23 Dec 2004 18:56:54 +0000 (GMT) Received: from av9-1-sn1.fre.skanova.net (av9-1-sn1.fre.skanova.net [81.228.11.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23F1343D3F for ; Thu, 23 Dec 2004 18:56:53 +0000 (GMT) (envelope-from ertr1013@student.uu.se) Received: by av9-1-sn1.fre.skanova.net (Postfix, from userid 502) id 49F7837F1A; Thu, 23 Dec 2004 19:56:52 +0100 (CET) Received: from smtp2-2-sn2.hy.skanova.net (smtp2-2-sn2.hy.skanova.net [81.228.8.178]) by av9-1-sn1.fre.skanova.net (Postfix) with ESMTP id 2BCCE37F12 for ; Thu, 23 Dec 2004 19:56:52 +0100 (CET) Received: from falcon.midgard.homeip.net (h201n1fls24o1048.bredband.comhem.se [212.181.162.201]) by smtp2-2-sn2.hy.skanova.net (Postfix) with SMTP id 7A5A937E44 for ; Thu, 23 Dec 2004 19:56:51 +0100 (CET) Received: (qmail 951 invoked by uid 1001); 23 Dec 2004 18:54:14 -0000 Date: Thu, 23 Dec 2004 19:54:14 +0100 From: Erik Trulsson To: Damien Hull Message-ID: <20041223185414.GA939@falcon.midgard.homeip.net> Mail-Followup-To: Damien Hull , freebsd-questions References: <20041221104508.1002.qmail@rahul.net> <41C8DC87.5080207@mac.com> <1103781420.16972.17.camel@tower1.digitaloverload.local> <20041223061448.GA74828@falcon.midgard.homeip.net> <20041223064841.18134.qmail@rahul.net> <20041223085239.GA20209@falcon.midgard.homeip.net> <1103824398.19000.13.camel@tower1.digitaloverload.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1103824398.19000.13.camel@tower1.digitaloverload.local> User-Agent: Mutt/1.5.6i cc: freebsd-questions Subject: Re: UFS2 with Soft Updates Robust? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2004 18:56:54 -0000 On Thu, Dec 23, 2004 at 08:53:18AM -0900, Damien Hull wrote: > On Thu, 2004-12-23 at 09:52 +0100, Erik Trulsson wrote: > > On Thu, Dec 23, 2004 at 06:48:41AM -0000, John Conover wrote: > > > Erik Trulsson writes: > > > > On Wed, Dec 22, 2004 at 08:57:00PM -0900, Damien Hull wrote: > > > > > On Tue, 2004-12-21 at 21:31 -0500, Chuck Swiger wrote: > > > > > > John Conover wrote: > > > > > > > Is UFS2 with soft updates the most robust file system in freebsd? > > > > > > > > > > > > No, although UFS2 with softupdates is robust enough for production use. > > > > > > > > > > > > If you make the filesystem writes syncronous and disable write caching on the > > > > > > hard drive, you will improve the robustness at significant cost to performance. > > > > > > > > > > > > > > > > Are you saying that the UFS2 file system sucks? > > > > > > > > Not at all, but standard IDE-drives suck when it comes to robustness. > > > > (They tend to lie and tell the OS that data has been written to the > > > > disk, when in reality it has only been written to the disks cache.) > > > > (Thus the advice above to turn off write-caching for maximum > > > > robustness.) > > > > > > > > If you use softupdates (on a disk that doesn't lie) the filesystem on > > > > the disk will always be consistent, but data written during the last 30 > > > > seconds or so might not yet have been written to the disk, and can therefore > > > > be lost if e.g. the power to the computer is turned off. > > > > > > > > > > Erik, does that mean if you use softupdates, (on a SCSI,) that, > > > although file(s) currently being written may be truncated since the > > > cache is not flushed, that the file system can be repaired > > > automatically by fsck to a consistent state? > > > > That is the idea. With softupdates the filesystem *on the disk* should > > always be in a consistent state, such that fsck should always succeed. > > (At least that is the theory, I haven't tested how well it holds in > > reality.) > > > > > > > > > > Even without synchronous writes or enabling cache write through? > > > > > > John > > > > > > BTW, the reason for the question is that most SCSIs today have many > > > meg of HW cache, and many, (maybe most,) controllers don't permit > > > write through anymore. So, even if the OS flushes its cache, the HW > > > cache may not be written to the disk-so synchronous writes and OS > > > cache write through may be of little value. > > > > The only cache that can mess up things is that on the disk itself. > > Forget about any caches managed by the OS - they are handled by the > > filesystem code and flushed when needed. > > > > > > The cache on the disk is another matter. One difference between SCSI > > and IDE is that SCSI support tagging which lets the OS determine if a > > given block has actually been written to the disk or just to the disk's > > cache. This is needed for softupdates to work correctly. > > > > On IDE-disks this information is often not available which means that > > you may need to disable the write-cache on the disk (or at least make > > it write-through) to be able to rely on the guarantees of softupdates. > > > > > > A few IDE-disks and some of the newer S-ATA disks also support tagged > > queueing, but support for that is not nearly as good as it is for SCSI > > - not yet anyway. > > > > > > Are you saying that it's not safe to use softupdates on IDE drives? I am saying that it is not safe to use IDE-drive with write-caching enabled. This holds regardless of whether you use soft-updates or not and for all operating systems and filesystems. > > I've always used softupdates on IDE and never had a problem. However, > I've never had a system that was under heave load. If lots of people are > writing to the drive ( I'm thinking file server) under softupdates it > sounds like something could go wrong. Something could go wrong, yes, but the risk is fairly small and the performance penalty when you disable write-caching is large enough that most people consider it a risk worth taking ( I certainly do.) > > Lets say I have a small network of 25 users. Were going to install a > file and print sever using FreeBSD 5.3 (UFS2). Because we don't have a > lot of money we get SATA drives. Should I use softupdates or not? Using softupdates should not hurt anything compared to not using softupdates. > > If I had more then 25 users I would consider getting SCSI. > -- > Damien Hull > -- Erik Trulsson ertr1013@student.uu.se