Soft Updates Help
Chuck Swiger
cswiger at mac.com
Fri Dec 1 16:25:20 PST 2006
On Dec 1, 2006, at 4:12 PM, Sean Murphy wrote:
> I have read up on soft updates and have some questions.
>
> The way that I am understanding soft updates purpose is to allow
> file systems to be mounted dirty after an unclean shutdown of the
> system. This will allow fsck to run in the background to restore
> the consistency of the file system which is compared against a
> snapshot of the system. It also increases performance of heavily
> written file systems by waiting to write the metadata of files and
> directories until a more opportune time.
>
> I have questions about this.
>
> When is the snapshot taken, how often, do I have to do it or does a
> program or kernel do it?
Snapshots are taken via mksnap_ffs; some other tools like fsck or
dump also know how to create a snapshot.
> If this is a safe way to restore consistency why is it not used on /?
You could enable softupdates on /, but normally one does not as /
does not contain files which are expected to change.
> If a file system is not heavily written to is it better not to use
> soft updates?
Maybe. I think that softupdates is a win in almost all circumstances
from the standpoint of data consistency, short of fully syncronous
data & metadata updates.
> How do I know when the background fsck is finished and if it was
> successful?
Check the logfiles.
> Do I have to add anything to enable the backgound fsck?
At one point, there was an option in /etc/rc.conf, but it now
defaults to being on:
% grep fsck /etc/defaults/rc.conf
fsck_y_enable="NO" # Set to YES to do fsck -y if the initial
preen fails.
background_fsck="YES" # Attempt to run fsck in the background where
possible.
background_fsck_delay="60" # Time to wait (seconds) before starting
the fsck.
> When file systems are mounted dirty and our being used while the
> backgound fsck is running on the file systems how does it prevent
> files from being lost?
The background fsck is only capable of handling innocuous filesystem
inconsistencies, and will fail with an error code if it encounters a
more significant issue, in which case the system is obligated to
perform the traditional fsck in the foreground.
--
-Chuck
More information about the freebsd-questions
mailing list