From owner-freebsd-stable@FreeBSD.ORG Thu Jun 30 18:48:18 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AA2EF16A422 for ; Thu, 30 Jun 2005 18:48:18 +0000 (GMT) (envelope-from lsc@jane.prgmr.com) Received: from jane.prgmr.com (host-69-19-197-42.rev.o1.com [69.19.197.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A9B943D55 for ; Thu, 30 Jun 2005 18:48:18 +0000 (GMT) (envelope-from lsc@jane.prgmr.com) Received: from lsc (helo=localhost) by jane.prgmr.com with local-esmtp (Exim 4.51 (FreeBSD)) id 1Do42J-000Hcd-A0; Thu, 30 Jun 2005 18:45:19 +0000 Date: Thu, 30 Jun 2005 18:45:19 +0000 (UTC) From: Luke Crawford To: Niki Denev In-Reply-To: <200506291704.50185.ndenev@icdsoft.com> Message-ID: <20050630174315.C66660@mail.prgmr.com> References: <200506291704.50185.ndenev@icdsoft.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: Luke Crawford Cc: freebsd-stable@freebsd.org Subject: Re: background fsck can be dangerous! X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 18:48:19 -0000 This is not a problem with background fsck... this is the way soft updates is supposed to handle a power failure. Soft updates is designed to allow safe write caching. It orders writes such that the filesystem is always consistent. The worst that can happen in the case of power loss is that new files are lost, and the hard drive has incessable data written to it. Background fsck essentially deletes those partially written files and frees the space. If you were not using soft updates, the filesystem would have been corrupted, so you would be forced to run fsck before mounting, and some of the files in question would still have been lost. >From what I understand, soft updates does increase the number of files lost upon a crash (over mounting a disk synchronously) because it caches meta data, but that is not a bug. Data loss upon power failure is a natural and unescapable consequence of caching writes. Soft updates orders things such that the data is lost one file at a time, rather than the default where data is lost randomly, requiring a fsck before remounting of the filesystem. You will loose less data if you mount your disks synchronously and disable soft updates. This will also greatly diminish write performance on your disks, and require foreground fsck. disabling background fsck while continuing to run soft updates will make little difference. Personally, I would recommend that you keep your disk mount configuration as it is, and that you buy a UPS. On Wed, 29 Jun 2005, Niki Denev wrote: > Hello, > > I want just to share my last experience with the combination of > power failure + background fsck. After the power returned and the > machine booted, it sheduled background fsck after 60 seconds, but > at this point most of the services were already started, and some of them > seemed to rely on files that were probably in unclean state before the check. > This unfortunately leaded to some lost email...after the fsck completed, > everything runs ok, but i have now set background_fsck to NO in rc.conf. > > Here is a sad sample from my qmail log file : > @4000000042c1badc24fc21cc delivery 1: > success: /libexec/ld-elf.so.1:_Shared_object_"libpq.so.3"_not_found,_required_by_"dspam"/did_0+0+1/ > @4000000042c1badc24fff25c status: local 2/30 remote 0/20 > @4000000042c1badc250151ec delivery 4: > success: /libexec/ld-elf.so.1:_Shared_object_"libpq.so.3"_not_found,_required_by_"dspam"/did_0+0+1/ > @4000000042c1badc2502bd34 status: local 1/30 remote 0/20 > @4000000042c1badc25050ef4 end msg 23982 > @4000000042c1badc2508b0a4 delivery 2: > success: /libexec/ld-elf.so.1:_Shared_object_"libpq.so.3"_not_found,_required_by_"dspam"/did_0+0+1/ > @4000000042c1badc250a9cd4 status: local 0/30 remote 0/20 > @4000000042c1badc250c7d4c end msg 24087 > @4000000042c1badc2510942c end msg 24040 > > > --niki > _______________________________________________ > freebsd-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-stable > To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org" >