Fundamentals: Volumes
Volume is an archive unit where Bacula stores backed up data, normally a tape or a named disk file where Bacula stores the data from one or more backup jobs. When backing up to tapes, a Volume is identical to a tape and when backing up to disks, a Volume is a file.
Bacula manages all its Volumes in Pools. In particular, a Job is not configured to write to any particular Volume, but to a set of Volumes called a Pool. Volumes of Bacula are always members of only one Pool. There can however be multiple pools.
The volume cycle management process is shown in the figure below:
The Volume retention period is defined as the time Bacula will not overwrite a Volume after it was last written to. Therefore, if you write to a volume with a retention period of 20 days once, the volume will not be overwritten for at least 20 days. If you write to it seven days in a row, the volume will not be overwritten for at least 27 days. Remember that Bacula will try to keep your data safe for as long as possible.
Storage Capacity Management
If you want to overwrite a backup, you need to overwrite the corresponding volume(s). Additionally, to be able to reuse a Volume, its retention period should expire first.
As we already noted, Bacula will try to keep your data safe as long as possible. This means that you can be in a situation (disk backups only) where your storage space is too small even if you defined correct retention periods. In such cases, you can use the ActionOnPurge directive requesting Bacula to truncate disk volumes and thus free storage space. For this to work, the bconsole ‘truncate’ command needs to be scheduled in an Admin job.
Limiting the Volume Size
Tapes
On tapes, we usually don’t need to explicitly limit the volume size, because the volume is identical to the tape which has a limited and defined maximum capacity.
Disks
On disks, on the other hand, as volumes are handled with files, there is a risk of filling the disk with only one volume, so we need to limit the volume size and number of volumes. We explained above how the volume retention periods are handled by Bacula. However, often we need to reuse our volumes as soon as possible to be able to reuse the storage space they are using during their retention periods. In the previous case described under the image, we should have restricted the use duration of the Volume.
There are several directives available to limit the occupied storage space in a Pool: Maximum Volumes, Maximum Volumes Bytes, etc. To browse through the directives, visit: Pool Resource.
These limitations can be managed manually (by the Administrator with console commands) or automatically (for instance with scripts or Admin jobs).
Volumes and Pool Modifications
Because of its great flexibility, Bacula can be puzzling. Let’s say you defined Maximum Volume Bytes to 10 GB and then realize that you want to move it to 15 GB. Then, you will modify your “Pool” resource definition. This is correct and will work for all new volumes created into the Pool. But the existing volumes are not modified by this change. To update the existing volumes already in the Pool with the new values you must update the existing volumes’ meta-data.
In bconsole, enter ‘update volume’ and answer the subsequent questions, or alternatively ‘update volume allfrompool=the-pool-name’, or use one of the graphical interfaces to update the existing volumes.
Go back to Bacula Enterprise Explained
Go back to the Bacula Enterprise Fundamentals chapter.