Soft Updates Help

Sean Murphy smurphy at calarts.edu
Fri Dec 1 17:42:50 PST 2006



Chuck Swiger wrote the following on 12/1/2006 4:25 PM:
> 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
>

Thank you for your knowledge on this issue.   I have a few questions 
that I need your help to clarify.

"Snapshots are taken via mksnap_ffs; some other tools like fsck or dump 
also know how to create a snapshot."

       OK, so if I understand this correctly I do not have to initially 
take a snapshot and update this snapshot manually.  The files system 
with soft updates does it correct?

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

       On this issue, if I do not have soft updates on does that make it 
a fully synchronous file system?

If the background fsck can't handle the inconsistencies it will report 
this in the /var/log/messages correct?  Then is the file system 
unmounted because of the inconsistency to prevent data loss, so I can 
run a manual fsck or does it stay mounted?

Thanks




More information about the freebsd-questions mailing list