*BSD News Article 21668


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!pipex!uknet!mcsun!sun4nl!tuegate.tue.nl!news.win.tue.nl!wzv.win.tue.nl!gvr.win.tue.nl!guido
From: guido@gvr.win.tue.nl (Guido van Rooij)
Newsgroups: comp.os.386bsd.questions
Subject: Re: what is fs_clean for?
Date: 30 Sep 1993 12:48:16 GMT
Organization: Eindhoven University of Technology, The Netherlands
Lines: 31
Message-ID: <28ekig$an2@wzv.win.tue.nl>
References: <28da76$fhf@acsc.com>
NNTP-Posting-Host: gvr.win.tue.nl

jerry@acsc.com (Jerry Chen) writes:

>In the superblock of UFS, there are two fields:

>ufs/fs.h:       char    fs_clean;               /* file system is clean flag */
>ufs/fs.h:       long    fs_state;               /* validate fs_clean field */

>My guess is that they are used to determine if the file system is clean, ie, umounted
>successfully.  And if the file system is clean, we do not need to fsck it since
>life is too short to always run fsck.

Yes. You are right
>Well, my guess must be wrong.  I grep the files under usr/src/sbin/fsck and 
>usr/src/sys.386bsd/ufs and it seems to me that fs_clean is not used (other than
>copied to altsblock.fs_clean) at all.  Does the BSD always run fsck?  Why is it?
>Thanks in advance for the answer.
No, your guess was right. However you need more then just these flags. A
patched fsck that checks these bits plus kernel modifications to unmount
ufs filesystems on reboot.
This was posted a long time ago when only 386bsd existed, but is in the
FreeBSD current source tree and should be available with the net release.
I assume NetBSD has a similar thing, though I am not sure.
> 
>Jerry JyhRen Chen

-Guido
-- 
Guido van Rooij                 |  Internet: guido@gvr.win.tue.nl
Bisschopsmolen 16               |  Phone:    ++31.40.461433
5612 DS Eindhoven               |  ((12+144+20)+3*sqrt(4))/7 
The Netherlands                 |    +(5*11)=9^2+0