Subject: Re: Off topic (where are the superblocks?)
To: None <current-users@NetBSD.ORG>
From: Hiroyuki Ito <hiroy@netcom.com>
List: current-users
Date: 06/02/1996 09:48:17
Andrew Wheadon <andrew@wipux2.wifo.uni-mannheim.de> wrote:
> I just need a quick info, where are the first superblocks
> (when the one at 32 has gone too.) ?
% uname -srm
NetBSD 1.1B i386
% sed -n 38,67p /usr/include/ufs/ffs/fs.h
/*
* Each disk drive contains some number of file systems.
* A file system consists of a number of cylinder groups.
* Each cylinder group has inodes and data.
*
* A file system is described by its super-block, which in turn
* describes the cylinder groups. The super-block is critical
* data and is replicated in each cylinder group to protect against
* catastrophic loss. This is done at `newfs' time and the critical
* super-block data does not change, so the copies need not be
* referenced further unless disaster strikes.
*
* For file system fs, the offsets of the various blocks of interest
* are given in the super block as:
* [fs->fs_sblkno] Super-block
* [fs->fs_cblkno] Cylinder group block
* [fs->fs_iblkno] Inode blocks
* [fs->fs_dblkno] Data blocks
* The beginning of cylinder group cg in fs, is given by
* the ``cgbase(fs, cg)'' macro.
*
* The first boot and super blocks are given in absolute disk addresses.
* The byte-offset forms are preferred, as they don't imply a sector size.
*/
#define BBSIZE 8192
#define SBSIZE 8192
#define BBOFF ((off_t)(0))
#define SBOFF ((off_t)(BBOFF + BBSIZE))
#define BBLOCK ((daddr_t)(0))
#define SBLOCK ((daddr_t)(BBLOCK + BBSIZE / DEV_BSIZE))
%
Hiroyuki Ito