Super Block

Jonathan I. Kamens jik at athena.mit.edu
Sat Jul 28 00:50:23 AEST 1990


In article <6911 at helios.TAMU.EDU>, peram at cs.tamu.edu (Suresh B Peram) writes:
|>    I want to know where I can find the Super Block.
|>    Is the super block present on the disk ?  If yes,
|>    where does it start from ?

  It depends on the filesystem.  On Berkeley filesystems, I believe that
the first super block is in block eight of the disk, and, to quote from
the fsck(8) man page, "Block 32 is always an alternate super block."

  Also, you should be able to use "newfs -N filesystem-name" to find out
where newfs would place the super blocks when creating the filesystem
again; if you created the filesystem originally with newfs in a
reasonably standard manner, that should tell where other super blocks
are.  For example:

    % /etc/newfs -N hd0a
    Warning: inode blocks/cyl group (27) >= data blocks (15) in last
        cylinder group. This implies 244 sector(s) cannot be allocated.
    /dev/rhd0a:     15680 sectors in 64 cylinders of 7 tracks, 35
sectors
            8.0Mb in 4 cyl groups (16 c/g, 2.01Mb/g, 704 i/g)
    super-block backups (for fsck -b#) at:
     32, 4000, 7968, 11936,

If you're concerned about doing something bad accidentally with newfs
and screwing up the disk, then temporarily make newfs setgid to whatever
group owns your disks, and make the disks group-readable but not
group-writeable, and then run the newfs commands as someone other than
root.  If newfs doesn't have the access, it can't clobber the disks....

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.wizards mailing list