Dedicated Restore Drive
CommunityEnterpriseWhen you set up your storage and drive, it can be useful to have a dedicated drive for restoration purpose as devices in Bacula cannot backup and restore at the same time. This applies to all device types. With virtual Autochangers (aka disk changers), you can create as many devices as you want, thus having dedicated ones fore restores plus a few spare ones is a good practice.
In order to have a dedicated device, you just need to add the Directive Autoselect = no
to a device definition in your Storage Daemon configuration.
An example device dedicated for a restore:
Device {
Name = RestoreDrive
Media Type = File
Archive Device = /pool/Backup_storage
LabelMedia = yes
Random Access = Yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Autoselect = no # this drive will not be selected for a backup
}
Virtual Autochanger Configuration and Restore Device Selection
In the bacula-dir.conf file, you can define an Autochanger as follows:
# Definition of file Virtual Autochanger device
Autochanger {
Name = File1
# Do not use "localhost" here
Address = bacula-sd # N.B. Use a fully qualified name here
SDPort = 9103
Password = "a+YXY3kfS9ObgZ52ebJT3W"
Device = FileChgr1
Media Type = File1
Maximum Concurrent Jobs = 10 # run up to 10 jobs a the same time
Autochanger = File1 # point to ourself
}
Storage {
Name = RestoreStorage1
# Do not use "localhost" here
Address = bacula-sd # N.B. Use a fully qualified name here
SDPort = 9103
Password = "a+YXY3kfS9ObgZ52ebJT3W"
Device = RestoreStorage1
Media Type = File1
Autochanger = File1 # point to the Autochanger
}
Above, we have added another Storage device definition in the Director that is named RestoreStorage1, and this device will be always ready in the Storage daemon to accept restore Job. Notice, that it is also part of the Autochanger definition because it points back to the Autochanger resource. During a restore, if all drives are busy, you can manually enter the Restore storage to be used for the restore.
In the bacula-sd.conf file, the equivalent definitions are:
#
# Define a Virtual autochanger
#
Autochanger {
Name = FileChgr1
Device = FileChgr1-Dev1, FileChgr1-Dev2, Restore
Changer Command = /dev/null
Changer Device = /dev/null
}
Device {
Name = FileChgr1-Dev1
Media Type = File1
Archive Device = /tmp
LabelMedia = yes # lets Bacula label unlabeled media
Random Access = Yes
AutomaticMount = yes # when device opened, read it
RemovableMedia = no
AlwaysOpen = no
Maximum Concurrent Jobs = 5
}
Device {
Name = FileChgr1-Dev2
Media Type = File1
Archive Device = /tmp
LabelMedia = yes # lets Bacula label unlabeled media
Random Access = Yes
AutomaticMount = yes # when device opened, read it
RemovableMedia = no
AlwaysOpen = no
Maximum Concurrent Jobs = 5
}
Device {
Name = RestoreStorage1
Media Type = File1
Archive Device = /tmp
LabelMedia = yes # lets Bacula label unlabeled media
Random Access = Yes
AutomaticMount = yes # when device opened, read it
RemovableMedia = no
AlwaysOpen = no
AutoSelect = no
}
Notice that we have set AutoSelect = no in the Device definition. This prevents Bacula from selecting that particular device for backup. When AutoSelect=no is present, the only way to use that Device is by explicitly referencing it (rather than the Autochanger) in the Director.
During the restore process, Bacula will choose the original Storage resource that was used to backup your files to restore your files, and if all devices are busy, you will be able to manually select the RestoreStorage and thus complete the restore.
If you are using Virtual autochanger or group of devices, you can add this Device to the Autochanger device group.
Note
In the case of a Tape Library, you can dedicate a tape drive or adjust Maximum Concurrent Job values in order to have one free “most of the time”. Your restore Job will then be processed once a drive is free. Priorities can be used to ensure restore jobs run as soon as possible, and backup jobs can be stopped or cancelled to free up drives.
See also
Previous articles:
Next articles:
Go back to: Backup Policy Configuration.