Bacula Enterprise Edition Documentation text image transdoc


Disaster Recovery Using Bacula


When disaster strikes, you must have a plan, and you must have prepared in advance otherwise the work of recovering your system and your files will be considerably greater. For example, if you have not previously saved the partitioning information for your hard disk, how can you properly rebuild it if the disk must be replaced? Unfortunately, many of the steps one must take before and immediately after a disaster are very operating system dependent.

Bacula Systems provides special LinuxBMR and WinBMRpackages that largely automate and simplify recovery even with a very large number of machines. The documentation and details of these products are contained in separate white papers. If you need them, please ask your Bacula Systems sales representative.

Below are a few additional points that may or may not help.

Important Considerations

Here are a few important considerations concerning disaster recovery that you should take into account before a disaster strikes.

  • If the building which houses your computers burns down or is otherwise destroyed, do you have off-site backup data?
  • Disaster recovery is much easier if you have several machines. If you have a single machine, how will you handle unforeseen events if your only machine is down?
  • Do you want to protect your whole system and use Bacula to recover everything? or do you want to try to restore your system from the original installation disks and apply any other updates and only restore user files?

FreeBSD Bare Metal Recovery

The same basic techniques described above also apply to FreeBSD. Although we don't yet have a fully automated procedure, Alex Torres Molina has provided us with the following instructions with a few additions from Jesse Guardiani and Dan Langille:

  1. Boot with the FreeBSD installation disk
  2. Go to Custom, Partition and create your slices and go to Label and create the partitions that you want. Apply changes.
  3. Go to Fixit to start an emergency console.
  4. Create devs ad0 .. .. if they don't exist under /mnt2/dev (in my situation) with MAKEDEV. The device or devices you create depend on what hard drives you have. ad0 is your first ATA drive. da0 would by your firstSCSI drive. Under OS version 5 and greater, your device files are most likely automatically created for you.
  5. mkdir /mnt/disk

    this is the root of the new disk

  6. mount /mnt2/dev/ad0s1a /mnt/disk
    mount /mnt2/dev/ad0s1c /mnt/disk/var
    mount /mnt2/dev/ad0s1d /mnt/disk/usr
    The same hard drive issues as above apply here too. Note, under OS version 5 or higher, your disk devices may be in /dev not /mnt2/dev.
  7. Network configuration
    ifconfig xl0 ip/mask + route add default ip-gateway
  8. mkdir /mnt/disk/tmp
  9. cd /mnt/disk/tmp
  10. Copy bacula-fd and bacula-fd.conf to this path
  11. If you need to, use sftp to copy files, after which you must do this:
    ln -s /mnt2/usr/bin /usr/bin
  12. chmod u+x bacula-fd
  13. Modify bacula-fd.conf to fit this machine
  14. Copy /bin/sh to /mnt/disk, necessary for chroot
  15. Don't forget to put your bacula-dir's IP address and domain name in /mnt/disk/etc/hosts if it's not on a public net. Otherwise the FD on the machine you are restoring to won't be able to contact the SD and DIR on the remote machine.
  16. mkdir -p /mnt/disk/var/db/bacula
  17.   chroot /mnt/disk /tmp/bacula-fd -c /tmp/bacula-fd.conf
    to start bacula-fd
  18. Now you can go to bacula-dir and restore the job with the entire contents of the broken server.
  19. You must create /proc

Solaris Bare Metal Recovery

The same basic techniques described above apply to Solaris:

  • the same restrictions as those given for Linux apply
  • you will need to create a Rescue disk

However, during the recovery phase, the boot and disk preparation procedures are different:

  • there is no need to create an emergency boot disk since it is an integrated part of the Solaris boot.
  • you must partition and format your hard disk by hand following manual procedures as described in W. Curtis Preston's book Unix Backup & Recovery

Once the disk is partitioned, formatted and mounted, you can continue with bringing up the network and reloading Bacula.

Preparing Solaris Before a Disaster

As mentioned above, before a disaster strikes, you should prepare the information needed in the case of problems. To do so, in the rescue/solaris subdirectory enter:


The getdiskinfo script will, as in the case of Linux described above, create a subdirectory diskinfo containing the output from several system utilities. In addition, it will contain the output from the SysAudit program as described in Curtis Preston's book. This file diskinfo/sysaudit.bsi will contain the disk partitioning information that will allow you to manually follow the procedures in the Unix Backup & Recovery book to repartition and format your hard disk. In addition, the getdiskinfo script will create a start_network script.

Once you have your disks repartitioned and formatted, do the following:

  • Start Your Network with the start_network script
  • Restore the Bacula File daemon as documented above
  • Perform a Bacula restore of all your files using the same commands as described above for Linux
  • Re-install your boot loader using the instructions outlined in the Unix Backup & Recovery book using installboot