Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jun 2005 18:45:19 +0000 (UTC)
From:      Luke Crawford <lsc@prgmr.com>
To:        Niki Denev <ndenev@icdsoft.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: background fsck can be dangerous!
Message-ID:  <20050630174315.C66660@mail.prgmr.com>
In-Reply-To: <200506291704.50185.ndenev@icdsoft.com>
References:  <200506291704.50185.ndenev@icdsoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050630174315.C66660>