From owner-freebsd-fs@FreeBSD.ORG Sun Jun 21 09:27:41 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92529106564A for ; Sun, 21 Jun 2009 09:27:41 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from ch-smtp02.sth.basefarm.net (ch-smtp02.sth.basefarm.net [80.76.149.213]) by mx1.freebsd.org (Postfix) with ESMTP id 1C6CE8FC12 for ; Sun, 21 Jun 2009 09:27:41 +0000 (UTC) (envelope-from erikt@midgard.homeip.net) Received: from c83-255-48-78.bredband.comhem.se ([83.255.48.78]:60487 helo=falcon.midgard.homeip.net) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.69) (envelope-from ) id 1MIJKt-0005sN-8F for freebsd-fs@freebsd.org; Sun, 21 Jun 2009 11:27:39 +0200 Received: (qmail 66113 invoked from network); 21 Jun 2009 11:27:36 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with ESMTP; 21 Jun 2009 11:27:36 +0200 Received: (qmail 92746 invoked by uid 1001); 21 Jun 2009 11:27:36 +0200 Date: Sun, 21 Jun 2009 11:27:36 +0200 From: Erik Trulsson To: Dan Naumov Message-ID: <20090621092736.GA92656@owl.midgard.homeip.net> References: <20090620231130.GA88907@owl.midgard.homeip.net> <3c1674c90906201808t1854dd46n82213fbd0c1c254c@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Originating-IP: 83.255.48.78 X-Scan-Result: No virus found in message 1MIJKt-0005sN-8F. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1MIJKt-0005sN-8F ca067a144d9fa50af6db86823b1baf6d Cc: freebsd-fs@freebsd.org, Kip Macy Subject: Re: ufs2 / softupdates / ZFS / disk write cache X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Jun 2009 09:27:41 -0000 On Sun, Jun 21, 2009 at 05:18:39AM +0300, Dan Naumov wrote: > Uh oh.... After some digging around, I found the following quote: "ZFS > is designed to work with storage devices that manage a disk-level > cache. ZFS commonly asks the storage device to ensure that data is > safely placed on stable storage by requesting a cache flush." at > http://www.solarisinternals.com/wiki/index.php/ZFS_Evil_Tuning_Guide I > guess this might be somewhat related to why in the "disk cache > disabled" scenario, ZFS suffers bigger losses than UFS2. If that quote is correct (and I have no real reason to doubt it) then it should probably be safe to enable the disk's write cache when used with ZFS. (That would make sense since UFS/FFS was originally designed to work with an older generation of disks that did not do any significant amount of write-caching (partly due to having very little cache on them), while ZFS has been designed to be used on modern hardware, and to be reliable even on cheap consumer-grade disks.) > > It is quite obvious at this point that disabling disk cache in order > have softupdates live in harmony with disks "lying" about whether disk > cache contents have actually been committed to the disk in not in any > way, shape or form a viable solution to the problem. On a sidenote, is > there any way I can test whether *MY* disk is truthful about writing > cache to disk or not? If you have IDE/SATA disks they will "lie". SCSI/SAS disks won't. SATA disks using NCQ should probably also be safe -- too bad FreeBSD does not support NCQ yet. > > In the past (this was during my previous foray into the FreeBSD world, > circa-2001/2002) I have suffered severe data corruption (leading to an > unbootable system) using UFS2 + softupdates on 2 different occasions > due to power losses and this past experience has me very worried about > the proper way to configure my system to avoid such incidents in the > future. > > > - Sincerely, > Dan Naumov > > -- Erik Trulsson ertr1013@student.uu.se