<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2008 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Old Depreciated Tape Format</TITLE> <META NAME="description" CONTENT="Old Depreciated Tape Format"> <META NAME="keywords" CONTENT="developers"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2008"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="developers.css"> <LINK REL="previous" HREF="Unix_File_Attributes.html"> <LINK REL="up" HREF="Storage_Media_Output_Format.html"> <LINK REL="next" HREF="Bacula_Porting_Notes.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1245" HREF="Bacula_Porting_Notes.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html1239" HREF="Storage_Media_Output_Format.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html1235" HREF="Unix_File_Attributes.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html1241" HREF="Contents.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html1243" HREF="GNU_Free_Documentation_Lice.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html1246" HREF="Bacula_Porting_Notes.html">Bacula Porting Notes</A> <B> Up:</B> <A NAME="tex2html1240" HREF="Storage_Media_Output_Format.html">Storage Media Output Format</A> <B> Previous:</B> <A NAME="tex2html1236" HREF="Unix_File_Attributes.html">Unix File Attributes</A> <B> <A NAME="tex2html1242" HREF="Contents.html">Contents</A></B> <B> <A NAME="tex2html1244" HREF="GNU_Free_Documentation_Lice.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION0011140000000000000000"></A> <A NAME="4135"></A> <A NAME="4136"></A> <BR> Old Depreciated Tape Format </H1> <P> The format of the Block Header (version 1.26 and earlier) is: <P> <PRE> uint32_t CheckSum; /* Block check sum */ uint32_t BlockSize; /* Block byte size including the header */ uint32_t BlockNumber; /* Block number */ char ID[4] = "BB01"; /* Identification and block level */ </PRE> <P> The format of the Record Header (version 1.26 or earlier) is: <P> <PRE> uint32_t VolSessionId; /* Unique ID for this session */ uint32_t VolSessionTime; /* Start time/date of session */ int32_t FileIndex; /* File index supplied by File daemon */ int32_t Stream; /* Stream number supplied by File daemon */ uint32_t DataSize; /* size of following data record in bytes */ </PRE> <P> <PRE> Current Bacula Tape Format 6 June 2001 Version BB01 is the old deprecated format. A Bacula tape is composed of tape Blocks. Each block has a Block header followed by the block data. Block Data consists of Records. Records consist of Record Headers followed by Record Data. :=======================================================: | | | Block Header | | (16 bytes version BB01) | |-------------------------------------------------------| | | | Record Header | | (20 bytes version BB01) | |-------------------------------------------------------| | | | Record Data | | | |-------------------------------------------------------| | | | Record Header | | (20 bytes version BB01) | |-------------------------------------------------------| | | | ... | Block Header: the first item in each block. The format is shown below. Partial Data block: occurs if the data from a previous block spills over to this block (the normal case except for the first block on a tape). However, this partial data block is always preceded by a record header. Record Header: identifies the Volume Session, the Stream and the following Record Data size. See below for format. Record data: arbitrary binary data. Block Header Format BB01 (deprecated) :=======================================================: | CheckSum (uint32_t) | |-------------------------------------------------------| | BlockSize (uint32_t) | |-------------------------------------------------------| | BlockNumber (uint32_t) | |-------------------------------------------------------| | "BB01" (char [4]) | :=======================================================: BBO1: Serves to identify the block as a Bacula block and also servers as a block format identifier should we ever need to change the format. BlockSize: is the size in bytes of the block. When reading back a block, if the BlockSize does not agree with the actual size read, Bacula discards the block. CheckSum: a checksum for the Block. BlockNumber: is the sequential block number on the tape. VolSessionId: a unique sequential number that is assigned by the Storage Daemon to a particular Job. This number is sequential since the start of execution of the daemon. VolSessionTime: the time/date that the current execution of the Storage Daemon started. It assures that the combination of VolSessionId and VolSessionTime is unique for all jobs written to the tape, even if there was a machine crash between two writes. Record Header Format BB01 (deprecated) :=======================================================: | VolSessionId (uint32_t) | |-------------------------------------------------------| | VolSessionTime (uint32_t) | |-------------------------------------------------------| | FileIndex (int32_t) | |-------------------------------------------------------| | Stream (int32_t) | |-------------------------------------------------------| | DataSize (uint32_t) | :=======================================================: VolSessionId: a unique sequential number that is assigned by the Storage Daemon to a particular Job. This number is sequential since the start of execution of the daemon. VolSessionTime: the time/date that the current execution of the Storage Daemon started. It assures that the combination of VolSessionId and VolSessionTime is unique for all jobs written to the tape, even if there was a machine crash between two writes. FileIndex: a sequential file number within a job. The Storage daemon enforces this index to be greater than zero and sequential. Note, however, that the File daemon may send multiple Streams for the same FileIndex. The Storage Daemon uses negative FileIndices to identify Session Start and End labels as well as the End of Volume labels. Stream: defined by the File daemon and is intended to be used to identify separate parts of the data saved for each file (attributes, file data, ...). The Storage Daemon has no idea of what a Stream is or what it contains. DataSize: the size in bytes of the binary data record that follows the Session Record header. The Storage Daemon has no idea of the actual contents of the binary data record. For standard Unix files, the data record typically contains the file attributes or the file data. For a sparse file the first 64 bits of the data contains the storage address for the data block. Volume Label :=======================================================: | Id (32 bytes) | |-------------------------------------------------------| | VerNum (uint32_t) | |-------------------------------------------------------| | label_date (float64_t) | |-------------------------------------------------------| | label_time (float64_t) | |-------------------------------------------------------| | write_date (float64_t) | |-------------------------------------------------------| | write_time (float64_t) | |-------------------------------------------------------| | VolName (128 bytes) | |-------------------------------------------------------| | PrevVolName (128 bytes) | |-------------------------------------------------------| | PoolName (128 bytes) | |-------------------------------------------------------| | PoolType (128 bytes) | |-------------------------------------------------------| | MediaType (128 bytes) | |-------------------------------------------------------| | HostName (128 bytes) | |-------------------------------------------------------| | LabelProg (32 bytes) | |-------------------------------------------------------| | ProgVersion (32 bytes) | |-------------------------------------------------------| | ProgDate (32 bytes) | |-------------------------------------------------------| :=======================================================: Id: 32 byte Bacula identifier "Bacula 1.0 immortal\n" (old version also recognized:) Id: 32 byte Bacula identifier "Bacula 0.9 mortal\n" LabelType (Saved in the FileIndex of the Header record). PRE_LABEL -1 Volume label on unwritten tape VOL_LABEL -2 Volume label after tape written EOM_LABEL -3 Label at EOM (not currently implemented) SOS_LABEL -4 Start of Session label (format given below) EOS_LABEL -5 End of Session label (format given below) label_date: Julian day tape labeled label_time: Julian time tape labeled write_date: Julian date tape first used (data written) write_time: Julian time tape first used (data written) VolName: "Physical" Volume name PrevVolName: The VolName of the previous tape (if this tape is a continuation of the previous one). PoolName: Pool Name PoolType: Pool Type MediaType: Media Type HostName: Name of host that is first writing the tape LabelProg: Name of the program that labeled the tape ProgVersion: Version of the label program ProgDate: Date Label program built Session Label :=======================================================: | Id (32 bytes) | |-------------------------------------------------------| | VerNum (uint32_t) | |-------------------------------------------------------| | JobId (uint32_t) | |-------------------------------------------------------| | *write_date (float64_t) VerNum 10 | |-------------------------------------------------------| | *write_time (float64_t) VerNum 10 | |-------------------------------------------------------| | PoolName (128 bytes) | |-------------------------------------------------------| | PoolType (128 bytes) | |-------------------------------------------------------| | JobName (128 bytes) | |-------------------------------------------------------| | ClientName (128 bytes) | |-------------------------------------------------------| | Job (128 bytes) | |-------------------------------------------------------| | FileSetName (128 bytes) | |-------------------------------------------------------| | JobType (uint32_t) | |-------------------------------------------------------| | JobLevel (uint32_t) | |-------------------------------------------------------| | FileSetMD5 (50 bytes) VerNum 11 | |-------------------------------------------------------| Additional fields in End Of Session Label |-------------------------------------------------------| | JobFiles (uint32_t) | |-------------------------------------------------------| | JobBytes (uint32_t) | |-------------------------------------------------------| | start_block (uint32_t) | |-------------------------------------------------------| | end_block (uint32_t) | |-------------------------------------------------------| | start_file (uint32_t) | |-------------------------------------------------------| | end_file (uint32_t) | |-------------------------------------------------------| | JobErrors (uint32_t) | |-------------------------------------------------------| | JobStatus (uint32_t) VerNum 11 | :=======================================================: * => fields deprecated Id: 32 byte Bacula Identifier "Bacula 1.0 immortal\n" LabelType (in FileIndex field of Header): EOM_LABEL -3 Label at EOM SOS_LABEL -4 Start of Session label EOS_LABEL -5 End of Session label VerNum: 11 JobId: JobId write_btime: Bacula time/date this tape record written write_date: Julian date tape this record written - deprecated write_time: Julian time tape this record written - deprecated. PoolName: Pool Name PoolType: Pool Type MediaType: Media Type ClientName: Name of File daemon or Client writing this session Not used for EOM_LABEL. </PRE> <P> <BR><HR> <ADDRESS> 2010-06-14 </ADDRESS> </BODY> </HTML>