newfs and mount vs. half-baked disks

Wes Peters wes at softweyr.com
Thu Nov 6 16:52:52 PST 2003


On Wednesday 05 November 2003 03:18, Bruce Evans wrote:
> On Tue, 4 Nov 2003, Wes Peters wrote:
> >
> > I emailed Kirk about this state of affairs and he confirmed that
> > newfs was developed with operator intervention in mind.  He
> > suggested employing one of the unused flags in the filesystem
> > header as a 'consistent' flag, setting it to 'not consistent' at
> > the beginning of newfs, and then updating to 'is consistent' at the
> > end.  The performance hit in updating all superblock copies at the
> > end is small but noticable (< 1s on a rather slow 6GB filesystem).
>
> There is no need to use a new flag.  Just set the magic number to a
> value different from both FS_UFS1_MAGIC and FS_UFS2_MAGIC, e.g., to
> 0, until newfs is nearly finished.

I specifically don't want to do that because I want the state 
"interrupted newfs operation" to be discernable from the state 
"something stomped on your superblock."  This I believe better shows 
that the superblock is valid but the filesystem is not (yet).

The name fs_state suggests someone was thinking of recording some sort 
of state in here that was never implemented.  I've simply used it to 
record states 'newfs operation completed' and 'newfs operation not 
completed.'

-- 
         "Where am I, and what am I doing in this handbasket?"

Wes Peters                                              wes at softweyr.com




More information about the freebsd-arch mailing list