Version BB02 Block Header
Keywords: developers

#
Version BB02 Block Header

Each session or Job has its own private block. As a consequence, the SessionId and SessionTime are written once in each Block Header and not in the Record Header. So, the second and current version of the Block Header BB02 is:

       uint32_t CheckSum;        /* Block check sum */
       uint32_t BlockSize;       /* Block byte size including the header */
       uint32_t BlockNumber;     /* Block number */
       char ID[4] = "BB02";      /* Identification and block level */
       uint32_t VolSessionId;    /* Applies to all records  */
       uint32_t VolSessionTime;  /*   contained in this block */

As with the previous version, the BB02 Block header is a fixed length and fixed format and is followed by Record Headers and Record Data. The CheckSum field is a 32 bit CRC checksum of the block data and the block header but not including the CheckSum field. The Block Header is always immediately followed by a Record Header. If the tape is damaged, a Bacula utility will be able to recover as much information as possible from the tape by recovering blocks which are valid. The Block header is written using the Bacula serialization routines and thus is guaranteed to be in machine independent format.