Re: newfs and mount vs. half-baked disks

From: Peter Jeremy (PeterJeremy_at_optushome.com.au)
Date: 11/05/03

  • Next message: Bruce Evans: "Re: newfs and mount vs. half-baked disks"
    Date: Wed, 5 Nov 2003 19:15:16 +1100
    To: Wes Peters <wes@softweyr.com>
    
    

    On Tue, Nov 04, 2003 at 07:57:10PM -0600, Dan Nelson wrote:
    >In the last episode (Nov 04), Wes Peters said:
    >> 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).
    >
    >Would writing a block of zeros to the first (or first n) superblock,
    >newfs'ing, then rewriting the correct data do the same thing without
    >affecting the filesystem itself? I'm thinking about 4.x and cross-OS
    >portability here.

    My suggestion would be to write a non-standard magic number to
    fs_magic in the primary and first backup superblock (block 32) - I
    believe these are the only ones fsck will automatically search. The
    "invalid" magic number means that neither mount nor fsck will
    recognize the partition. Those two blocks can be re-written at the
    end - the additional time should be unnoticable. The remaining
    superblocks would appear valid but if someone is silly enough to
    manually specify a alternate superblock in an incompletely newfs'd
    filesystem, they get a neat hole in their foot. (A known non-standard
    magic number would also allow fsck to warn that the filesystem was
    incompletely newfs'd).

    I'm surprised that this bug hasn't been noticed previously.

    Peter
    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: Bruce Evans: "Re: newfs and mount vs. half-baked disks"

    Relevant Pages

    • Limiting the number of Superblock duplicates on newfs of huge filesystem
      ... I don't have to newfs filesystems very often so I don't run into this ... I have just built a 500+ GByte RAID-5 user data filesystem. ... I am quite happy to have superblock ... superblock duplicates that get created on a ufs filesystem. ...
      (SunManagers)
    • Re: Is this Hard drive dead, Jim?
      ... > can give a second opinion. ... you must specify the filesystem type ... > The superblock could not be read or does not describe a correct ext2 ...
      (comp.os.linux.hardware)
    • Re: newfs and mount vs. half-baked disks
      ... > clean we just newfs and mount the clean new filesystem. ... > performance hit in updating all superblock copies at the end is small ... since the superblock for the previous file system may ... Newfs should also set the unclean flags and any related flags until it ...
      (freebsd-arch)
    • Re: Failure to Mount
      ... > fstab says that hdb has 3 primary partitions, ... Filesystem magic number: 0xEF53 ... Couldn't find ext2 superblock, trying backup blocks... ... Couldn't find valid filesystem superblock.# ./tune2fs ...
      (comp.os.linux.misc)
    • Problem recovering a failed RIAD5 array with 4-drives.
      ... good drives with no luck. ... Persistence: Superblock is persistent ... Number Major Minor RaidDevice State ... The filesystem revision is apparently too high for this version of e2fsck. ...
      (Linux-Kernel)