A Root block contains very important information about the structure of a SFS disk.
It has information on the location and size of the disk, the blocksize used,
locations of various important blocks, version information and some filesystem specific
settings.
A SFS disk has two Root blocks; one located at the start of the partition and one at
the end. On startup the filesystem will check both Roots to see if it is a valid SFS
disk. If either one is missing SFS can still continue (although at the moment it
won't).
A Root block could be missing on purpose. For example, if you extend the
partition at the end (adding a few MB's) then SFS can detect this with the information
stored in the Root block located at the beginning (since only the end-offset has changed).
Same goes for the other way around, as long as you don't change start and end point
at the same time.
When a Root block is missing because the partition has been made a bit larger, then SFS
will in the future be able to resize itself without re-formatting the disk.
Field |
Type |
Description |
bheader |
struct fsBlockHeader |
Standard block header. |
version |
UWORD |
The version of the filesystem block structure. You can check this
field to identify what version of the filesystem your dealing with it and to see if you
can handle this structure correctly. Don't try to interpret the disk's structure
when this field contains an unknown version number! |
sequencenumber |
UWORD |
Used to identify which Root block was written last in case the
sequencenumber on both Root blocks don't match. |
datecreated |
ULONG |
Creation date of this volume. This is the date when the disk was
last formatted and will never be changed. |
bits |
UBYTE |
Various settings, see below. |
pad1 |
UBYTE |
Reserved, leave zero. |
pad2 |
UWORD |
Reserved, leave zero. |
reserved1 |
ULONG[2] |
Reserved, leave zero. |
firstbyteh |
ULONG |
High 32-bits of a 64-bit number. This is the first byte of our
partition relative to the start of the disk. |
firstbyte |
ULONG |
Low 32-bits of a 64-bit number. |
lastbyteh |
ULONG |
High 32-bits of a 64-bit number. This is the last byte (exclusive)
of our partition relative to the start of the disk. |
lastbyte |
ULONG |
Low 32-bits of a 64-bit number. |
totalblocks |
ULONG |
The total number of blocks this partition consists of. |
blocksize |
ULONG |
The size of a block of this partition. |
reserved2 |
ULONG[2] |
Reserved, leave zero. |
reserved3 |
ULONG[8] |
Reserved, leave zero. |
bitmapbase |
BLCK |
Block number of the start of the Bitmap. |
adminspacecontainer |
BLCK |
Block number of the first AdminSpaceContainer. |
rootobjectcontainer |
BLCK |
Block number of the ObjectContainer which
contains the root of the disk (this is where the volume name is stored). |
extentbnoderoot |
BLCK |
Block number of the root of the Extent B-Tree. |
reserved4 |
ULONG[4] |
Reserved, leave zero. |
struct fsRootBlock {
struct fsBlockHeader bheader;
UWORD version;
UWORD sequencenumber;
ULONG datecreated;
UBYTE bits;
UBYTE pad1;
UWORD pad2;
ULONG reserved1[2];
ULONG firstbyteh;
ULONG firstbyte;
ULONG lastbyteh;
ULONG lastbyte;
BLCK totalblocks;
ULONG blocksize;
ULONG reserved2[2];
ULONG reserved3[8];
BLCK bitmapbase;
BLCK adminspacecontainer;
BLCK rootobjectcontainer;
BLCK extentbnoderoot;
ULONG reserved4[4];
};
|