New newfs vs. half-baked disks patch

Wes Peters wes at
Tue Nov 11 13:52:09 PST 2003

I re-did the patch using a differing magic number, as suggested.  This 
approach works quite nicely.  The patch is smaller and does more with 
no kernel mods.

This patch does more because a filesystem partially created with newfs 
now has an invalid magic number on the first superblock.  This means 
older kernels will not mount the filesystem and older fsck will at 
least warn about not finding the first superblock.

This patch includes a change to fsck so it will recognize an incomplete 
newfs filesystem, exiting with a unique status (11) and issuing the 
message "This volume is incomplete, run newfs again."

The patch to newfs includes the -E flag to generate error conditions; 
these changes will be committed separately.  Barring lack of 
objections, I'd like to commit this tomorrow.

Thanks to everyone who commented on the first round.  This was my first 
foray into filesystem programming since my Minix days and you were all 
more than generous.

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

Wes Peters                                              wes at

-------------- next part --------------
A non-text attachment was scrubbed...
Name: newfs.patch
Type: text/x-diff
Size: 3771 bytes
Desc: not available
Url :

More information about the freebsd-arch mailing list