peram@cs.tamu.edu (Suresh B Peram) (07/27/90)
Hi, 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 ? Suresh
jik@athena.mit.edu (Jonathan I. Kamens) (07/27/90)
In article <6911@helios.TAMU.EDU>, peram@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@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710
guy@auspex.auspex.com (Guy Harris) (07/29/90)
> It depends on the filesystem.
As does the format of the superblock.
The next question is "why does he think he needs to get at the
superblock"? If he just wants to be able to find out, say, how much
free space there is on the disk, he may be able to get that with a
system call; unfortunately, he didn't tell us what flavor of UNIX he's
running, so there's not much help we can give him without guessing -
perhaps incorrectly - which flavor he has....