Thursday, September 23, 2010

VTOC Boot Block and ther file system stuff - Solaris

Operating systems on Intel / IDE architecture follow a very simple way of managing partitions - they keep the first 512 bytes (0th Sector) reserved for storing partition table and the first stage of boot loader program. The partition table is a 64 byte table and since information about one partition requires 16 bytes space in it, it can store only upto 4 partition's information and thus the concept of only 4 primary partitions on such an architecture.

In Solaris, the partition information is also stored in the first sector but unlike the Intel/IDE inherent architecture, here the entire sector is used up for storing just the partition's information only. There are 0 to7 - 8 slices (partition's are known as slices in Solaris) and all their related information - type, start end cylinder number etc in kept in this table which is called as Volume Table of Contents or VTOC.


A typical Sparc based disk layout is as follows:

Let's not forget that 16 sectors make up 8 Kilobytes - 1 Block in UFS filesystem
So very first block in every slice (or a file system) is reserved for VTOC and Boot Block. It is just that they contain data in case it slice 0 and for the other slices, this block in inactive.

Slice 0
===========
1st block
VTOC - Sector 0
Boot Block - Sector 1 to Sector  15

2nd block
Primary Superblock - Sector 16 to 31


3rd block onwards

Backup Superblock, Cylinder Group Blocks, I-Node list, Data Blocks
============
In every slice (except slice 2, which represents the whole disk), the order and purpose of the blocks is same. It is just that first block is practically of no use and does not contain any data though being reserved.

Super block data reflects the health of the file system that includes - number of data blocks, cylinder blocks, size of a data block, mount point for the slice, state flag - clean, stable, active, logging or unknown.

Cylinder groups are meant for faster data access. Each file system is broken down into cylinder groups with keeping 16 (default) cylinders in a group. Disk writes are attempted to a file's data into a single cylinder group but large files can also be stored across multiple several cylinder groups.

Cylinder group block is a table within a cylinder group that defines a cylinder group - number of inodes, number of data blocks, number of directories, free blocks, free inodes, free fragments in the cylinder group, free block map, used inode map.
Cylinder group also contains a backup copy of the super block in the very beginning.  

No comments:

Post a Comment

Drooling Over Docker #4 — Installing Docker CE on Linux

Choosing the right product Docker engine comes in 2 avatars — Docker Community Edition (CE) and Docker Enterprise Edition (EE). While the...