Technical

VBLK - Technical

Previous Next

Introduction

The VBLKs are the workhorse of the database. Each Disk Group, Disk, Volume, Partition and Component is represented by a group of VBLKs. The elements' relationships are shown in the Database Overview.

Each VBLK is 128 bytes long and has a standard 16 byte header. Sometimes the VBLK isn't large enough to store all the information, so the record will be fragmented across several VBLKs (which will have the same Group Number).

A table size of P implies the field is prefixed by a one byte length marker. Unless a string is listed as NULL terminated, it isn't.

Note to writers: there are 3 types of variable length integer fields:
1. Variable length UInt32 (length <= 4)
2. Variable length UInt64 (length <= 8)
3. Padded Variable length UInt64 (length <= 4 or length = 8)
for values not within the range of UInt32, this type must have a length prefix of 8. zeros should be added if necessary.

Standard VBLK Header

Every VBLK has a standard 16 byte header, containing accounting information.

Offset Size Description
0x00 4 VBLK Magic Number
0x04 4 Sequence Number
0x08 4 Group Number
0x0C 2 Fragment Number (x of y)
0x0E 2 Number of fragments (VBLKs)

Notes

The Sequence Numbers start at 4. 0 - 3 are effectively the VMDB Header block.

The Group Number of an occupied VBLK is never zero.

The Record Type can be 0x32 (Component), 0x33 (Partition), 0x34 / 0x44 (Disk), 0x35 / 0x45 (Disk Group) or 0x51 (Volume). Note that the first 4 bits denote the revision of the record, and the last 4 denote the type.

LBA values in extent / volume / component records refer to logical 512-byte blocks within the public region of the disk, regardless of the actual sector size of the disk. ("All disks holding extents for a given volume must have the same sector size").

Fragmented Records

The number of VBLK fragments is shown in Number of Fragments. Fragment Number is a zero-based index. To keep track of the record, each set is given a unique Group Number.

N.B. Fragmented VBLKs may not be located contiguously in the VMDB.

Update Status

To prevent data loss during updates, changes to the VBLKs are logged. In the event of a power failure, the database can be rolled back to a consistant state. The table below shows what each VBLK Update Status means.

Flag Description
0x00 Record is active (consistant state)
0x01 Record is still active, but pending deletion
0x02 Record is pending activation

Volume Record (0x51)

Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length (e)
0x08 P Object Id (VarUInt64) (g)
.. P Name (string)
.. P Volume Type (string) (b)
.. P Disable Driver Letter Assignment (string) (f)
.. 14 Volume State (string, null padded) (c)
.. 1 Read Policy (see below)
.. P Volume Number (VarUInt32) (d)
.. 4 Volume Flags (see below)
.. P Number of Components (VarUInt32)
.. 8 Commit Transaction ID (h)
.. 8
Unknown Transaction ID
.. P Size LBA (PaddedVarUInt64)
.. 4 Zeros
.. 1 Partition Type (see below)
.. 16 Volume GUID
.. P
Id1? (VarUInt64)
.. P
Id2? (VarUInt64)
.. P
Column Size LBA (PaddedVarUInt64)
.. P
Mount Hint (string)

The record flags denote the presence of an optional field

N.B. Id1 and Id2 are mutually exclusive.

N.B. The optional fields will always be in the order: Id, Size, Mount Hint

Record Flags:

Flag Description
0x08 Id1?
0x20 Id2?
0x80 Column Size
0x02 Mount Hint

Volume Flags:

Flag Description
0x000001 writeback
0x000002 writecopy
0x000004 crashed
0x000010
Unknown (default)
0x000100 badlog
0x000400 kdetach
0x000800 storage
0x001000 apprecover
0x002000 pending
0x100000 raid-ntft
0x200000 boot-volume
0x400000 system-volume
0x800000 retain-partition

Read Policy:

Value Description
1 Round
2 Prefer
3 Select
4 RAID

Partition Type:

Value Description
0x06 RAW or FAT16
0x07 NTFS
0x0B FAT32

(a) Revision 5 of record type 1
(b) Volume Type: gen or raid5
(c) Volume State: ACTIVE or SYNC (for RAID 5)
(d) Initialized as 0xFFFFFFFF, Starts at 5 and unused numbers are reused
(e) length in bytes (this does not include VBLK headers)
(f) Disable driver letter assignment: 8000000000000000
(g) The ID of the object will be the Transaction ID that created this object
(h) Transaction ID of the last update

Component (0x32)

Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length
0x08 P Object Id (VarUInt64)
.. P Name (string)
.. P Volume State (string) (b)
.. 1 Partition Layout (see below)
.. 4 Component Flags (see below)
.. P Number of Partitions (VarUInt32)
.. 8 Commit Transaction Id
.. 8 Zeros
.. P Volume Id (VarUInt64)
.. P Log SD (VarUInt64)
.. P
Stripe Size LBA (PaddedVarUInt64)
.. P
Number of Columns (VarUInt32)

The record flags denote the presence of an optional field

Record Flags:

Flag Description
0x10 Both optional fields

Component Flags:

Flags Description
0x02 recover
0x04 iofail
0x08 pending

Partition Layout:

Value Description
1 Stripe
2 Concatenated (simple and spanned volumes)
3 RAID 5

(a) Revision 3 of record type 2
(b) Volume State: ACTIVE

Partition (0x33)

Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length
0x08 P Object Id (VarUInt64)
.. P Name (string)
.. 4 Partition Flags (see below)
.. 8 Commit Transaction Id
.. 8 Disk Offset LBA
.. 8 Partition Offset In Column LBA
.. P Size LBA (PaddedVarUInt64)
.. P Component Id (VarUInt64)
.. P Disk Id (VarUInt64)
.. P
Column Index (VarUInt32)
.. 8
Unknown Transaction ID
.. P
Unknown1 (VarUInt32)
.. P
Hidden (sectors?) Count (PaddedVarUInt64)

The record flags denote the presence of an optional field

Record Flags:

Flag Description
0x08 Column Index
0x20 Unknown Transaction ID
0x40 Unknown1
0x02 Hidden Count

Partition Flags:

Flag Description
0x0008 recover
0x0010 kdetach
0x0020 relocate
0x0040 boot-extended
0x0100 origboot
0x1000 volatile

(a) Revision 3 of record type 3

Disk (0x34)

Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length
0x08 P Object Id (VarUInt64)
.. P Name (string)
.. P Disk GUID (string)
.. P Last Device Name (string)
.. 4 Disk Flags (see below)
.. 8 Commit Tranaction Id

N.B. This record type doesn't have any flags

(a) Revision 3 of record type 4

Disk (0x44)

Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length
0x08 P Object Id (VarUInt64)
.. P Name (string)
.. 16 Disk GUID (binary)
.. 16 Disk Set GUID (binary)
.. P Last Device Name (string)
.. 4 Disk Flags (see below)
.. 8 Commit Transaction Id

N.B. This record type doesn't have any flags

(a) Revision 4 of record type 4

Disk Flags:

Flag Description
0x0001 reserved
0x0002 spare
0x0004 failing
0x0008 encap-pending
0x0010 merge-required
0x0100 removed
0x0200 detached

Disk Group (0x35)

Disk group name limited to 18 chars
Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length
0x08 P Object Id (VarUInt64)
.. P Name (string)
.. P Disk Group GUID (string)
.. 4 Zeros
.. 8 Commit Transaction Id
.. P
Number Of Config Copies (VarUInt32) (b)
.. P
Number Of Log Copies (VarUInt32) (b)
.. P
Minors Greater Than Or Equal To (VarUInt32) (c)

The record flags denote the presence of an optional field

Flag Description
0x08 Number Of Copies
0x10 Number of Minors

(a) Revision 3 of record type 5
(b) Special values: 0xFFFFFFFF means 'all', 0 means 'default'.
(c) Default is 0

Disk Group (0x45)

Offset Size Description
0x00 2 Update Status
0x02 1 Record Flags (see below)
0x03 1 Record type and revision (a)
0x04 4 Record length
0x08 P Object Id (VarUInt64)
.. P Name (string)
.. 16 Disk Group GUID (binary)
.. 16 Last Disk Set GUID (binary)
.. 4 Zeros
.. 8 Commit Transaction Id
.. P
Number Of Config Copies (VarUInt32)
.. P
Number Of Log Copies (VarUInt32)
.. P
Minors Greater Than Or Equal To (VarUInt32)

The record flags denote the presence of an optional field

Flag Description
0x08 Number Of Copies
0x10 Number of Minors

(a) Revision 4 of record type 5


Copyright © 2001-2015