Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 157

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!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>Disaster Recovery Using Bacula</TITLE>
<META NAME="description" CONTENT="Disaster Recovery Using Bacula">
<META NAME="keywords" CONTENT="main">
<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="main.css">

<LINK REL="next" HREF="Bacula_TLS_Communications.html">
<LINK REL="previous" HREF="Windows_Version_Bacula.html">
<LINK REL="up" HREF="Bacula_Main_Reference.html">
<LINK REL="next" HREF="Bacula_TLS_Communications.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1847"
  HREF="Bacula_TLS_Communications.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1841"
  HREF="Bacula_Main_Reference.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1835"
  HREF="Windows_Version_Bacula.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1843"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1845"
  HREF="Thanks.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1848"
  HREF="Bacula_TLS_Communications.html">Bacula TLS - Communications</A>
<B> Up:</B> <A NAME="tex2html1842"
  HREF="Bacula_Main_Reference.html">Bacula Main Reference</A>
<B> Previous:</B> <A NAME="tex2html1836"
  HREF="Windows_Version_Bacula.html">The Windows Version of</A>
 &nbsp; <B>  <A NAME="tex2html1844"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1846"
  HREF="Thanks.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html1849"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003810000000000000000">General</A>
<LI><A NAME="tex2html1850"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003820000000000000000">Important Considerations</A>
<LI><A NAME="tex2html1851"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003830000000000000000">Steps to Take Before Disaster Strikes</A>
<LI><A NAME="tex2html1852"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003840000000000000000">Bare Metal Recovery on Linux with a Rescue CD</A>
<LI><A NAME="tex2html1853"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003850000000000000000">Requirements</A>
<LI><A NAME="tex2html1854"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003860000000000000000">Restoring a Client System</A>
<LI><A NAME="tex2html1855"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870000000000000000">Boot with your Rescue CDROM</A>
<UL>
<LI><A NAME="tex2html1856"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870010000000000000">Start the Network:</A>
<LI><A NAME="tex2html1857"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870020000000000000">Partition Your Hard Disk(s):</A>
<LI><A NAME="tex2html1858"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870030000000000000">Format Your Hard Disk(s):</A>
<LI><A NAME="tex2html1859"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870040000000000000">Mount the Newly Formatted Disks:</A>
<LI><A NAME="tex2html1860"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870050000000000000">Somehow get the static File daemon loaded on your system</A>
<LI><A NAME="tex2html1861"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870060000000000000">Restore and Start the File Daemon:</A>
<LI><A NAME="tex2html1862"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870070000000000000">Restore Your Files:</A>
<LI><A NAME="tex2html1863"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870080000000000000">Final Step:</A>
<LI><A NAME="tex2html1864"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003870090000000000000">Reboot:</A>
</UL>
<BR>
<LI><A NAME="tex2html1865"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003880000000000000000">Restoring a Server</A>
<LI><A NAME="tex2html1866"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION003890000000000000000">Linux Problems or Bugs</A>
<LI><A NAME="tex2html1867"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038100000000000000000">Bare Metal Recovery using a LiveCD</A>
<LI><A NAME="tex2html1868"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038110000000000000000">FreeBSD Bare Metal Recovery</A>
<LI><A NAME="tex2html1869"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038120000000000000000">Solaris Bare Metal Recovery</A>
<LI><A NAME="tex2html1870"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038130000000000000000">Preparing Solaris Before a Disaster</A>
<LI><A NAME="tex2html1871"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038140000000000000000">Bugs and Other Considerations</A>
<UL>
<LI><A NAME="tex2html1872"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038140010000000000000">Directory Modification and Access Times are Modified on pre-1.30
Baculas :</A>
<LI><A NAME="tex2html1873"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038140020000000000000">Strange Bootstrap Files:</A>
</UL>
<BR>
<LI><A NAME="tex2html1874"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038150000000000000000">Disaster Recovery of Win32 Systems</A>
<LI><A NAME="tex2html1875"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038160000000000000000">Ownership and Permissions on Win32 Systems</A>
<LI><A NAME="tex2html1876"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038170000000000000000">Alternate Disaster Recovery Suggestion for Win32 Systems</A>
<LI><A NAME="tex2html1877"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038180000000000000000">Restoring to a Running System</A>
<LI><A NAME="tex2html1878"
  HREF="Disaster_Recovery_Using_Bac.html#SECTION0038190000000000000000">Additional Resources</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION003800000000000000000"></A>
<A NAME="RescueChapter"></A>
<BR>
Disaster Recovery Using Bacula
</H1>
<A NAME="19142"></A>
<A NAME="19143"></A>
<A NAME="19144"></A>
<A NAME="19145"></A>

<P>

<H1><A NAME="SECTION003810000000000000000">
General</A>
</H1>
<A NAME="19147"></A>

<P>
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?

<P>
Unfortunately, many of the steps one must take before and immediately after
a disaster are very operating system dependent.  As a consequence, this
chapter will discuss in detail disaster recovery (also called Bare Metal
Recovery) for <B>Linux</B> and <B>Solaris</B>.  For Solaris, the procedures
are still quite manual.  For FreeBSD the same procedures may be used but
they are not yet developed.  For Win32, a number of Bacula users have
reported success using BartPE.

<P>
<A NAME="considerations1"></A>
<H1><A NAME="SECTION003820000000000000000">
Important Considerations</A>
</H1>
<A NAME="19152"></A>
<A NAME="19153"></A>

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

<P>

<UL>
<LI>If the building which houses your computers burns down or is otherwise 
   destroyed, do you have off-site backup data? 
</LI>
<LI>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? 
</LI>
<LI>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? 
</LI>
</UL>

<P>
<A NAME="steps1"></A>
<H1><A NAME="SECTION003830000000000000000">
Steps to Take Before Disaster Strikes</A>
</H1>
<A NAME="19158"></A>
<A NAME="19159"></A>

<P>

<UL>
<LI>Create a rescue or CDROM for each of your Linux systems. Generally,
   they are offered by each distribution, and there are many good 
   rescue disks on the Web (Knoppix, sysrescuecd, PLD Linux rescue CD,
   tomsrtbt, RIP ...

<P>
</LI>
<LI>Create a bacula-hostname directory on 
   each machine and save it somewhere - possibly on a USB key.
</LI>
<LI>Ensure that you always have a valid bootstrap file for your backup and 
   that it is saved to an alternate machine.  This will permit you to
   easily do a full restore of your system.
</LI>
<LI>If possible copy your catalog nightly to an alternate machine.  If you
   have a valid bootstrap file, this is not necessary, but  can be very useful if
   you do not want to reload everything. .  
</LI>
<LI>Ensure that you always have a valid bootstrap file for your  catalog
   backup that is saved to an alternate machine. This will  permit you to restore
   your catalog more easily if needed.  
</LI>
<LI>Test using the Rescue CDROM before you are forced to use it in
   an emergency situation.
</LI>
<LI>Make a copy of your Bacula .conf files, particularly your
   bacula-dir.conf, and your bacula-sd.conf files, because if your server
   goes down, these files will be needed to get it back up and running,
   and they can be difficult to rebuild from memory.
</LI>
</UL>

<P>
<A NAME="rescueCDROM"></A>
<H1><A NAME="SECTION003840000000000000000">
Bare Metal Recovery on Linux with a Rescue CD</A>
</H1>
<A NAME="19164"></A>
<A NAME="19165"></A>

<P>
As an alternative to creating a Rescue CD, please see the
section below entitled Bare Metal Recovery using a LiveCDLiveCD.

<P>
Bacula previously had a Rescue CD.  Unfortunately, this CD did not work
on every Linux Distro, and in addition, Linux is evolving with different
boot methods, more and more complex hardware configurations (LVM, RAID, 
WiFi, USB, ...).  As a consequence, the Bacula Rescue CD as it was
originally envisioned no longer exists.

<P>
However there are many other good rescue disks available.
A so called "Bare Metal" recovery is one where you start with an empty hard
disk and you restore your machine. There are also cases where you may lose a
file or a directory and want it restored. Please see the previous chapter for
more details for those cases. 

<P>
Bare Metal Recovery assumes that you have the following items for your system:

<P>

<UL>
<LI>A Rescue CDROM containing a copy of your OS.
</LI>
<LI>Perhaps a copy of your
   hard disk information, as well as a statically linked version of the
   Bacula File daemon.  
</LI>
<LI>A full Bacula backup of your system possibly including  Incremental or
   Differential backups since the last Full  backup 
</LI>
<LI>A second system running the Bacula Director, the Catalog, and the
   Storage daemon.  (this is not an absolute requirement, but how to get
   around it is not yet documented here)
</LI>
</UL>

<P>

<H1><A NAME="SECTION003850000000000000000">
Requirements</A>
</H1>
<A NAME="19171"></A>

<P>
<A NAME="restore_client"></A>
<H1><A NAME="SECTION003860000000000000000">
Restoring a Client System</A>
</H1>
<A NAME="19174"></A>
<A NAME="19175"></A>

<P>
Now, let's assume that your hard disk has just died and that you have replaced
it with an new identical drive. In addition, we assume that you have: 

<P>

<OL>
<LI>A recent Bacula backup (Full plus Incrementals)  
</LI>
<LI>A Rescue CDROM.  
</LI>
<LI>Your Bacula Director, Catalog, and Storage daemon running  on another
   machine on your local network. 
</LI>
</OL>

<P>
This is a relatively simple case, and later in this chapter, as time permits,
we will discuss how you might recover from a situation where the machine that
crashes is your main Bacula server (i.e. has the Director, the Catalog, and
the Storage daemon). 

<P>
You will take the following steps to get your system back up and running: 

<P>

<OL>
<LI>Boot with your Rescue CDROM.  
</LI>
<LI>Start the Network (local network)  
</LI>
<LI>Re-partition your hard disk(s) as it was before  
</LI>
<LI>Re-format your partitions  
</LI>
<LI>Restore the Bacula File daemon (static version)  
</LI>
<LI>Perform a Bacula restore of all your files  
</LI>
<LI>Re-install your boot loader  
</LI>
<LI>Reboot 
</LI>
</OL>

<P>
Now for the details ... 

<P>

<H1><A NAME="SECTION003870000000000000000">
Boot with your Rescue CDROM</A>
</H1>
<A NAME="19181"></A>
<A NAME="19182"></A>

<P>
Each rescue disk boots somewhat differently.  Please see the
instructions that go with your CDROM.

<P>

<H4><A NAME="SECTION003870010000000000000">
Start the Network:</A>
</H4>

<P>

<P>
You can test it by pinging another machine, or pinging your broken machine
machine from another machine. Do not proceed until your network is up. 

<P>

<H4><A NAME="SECTION003870020000000000000">
Partition Your Hard Disk(s):</A>
</H4>

<P>

<H4><A NAME="SECTION003870030000000000000">
Format Your Hard Disk(s):</A>
</H4>

<P>

<H4><A NAME="SECTION003870040000000000000">
Mount the Newly Formatted Disks:</A>
</H4>

<P>

<H4><A NAME="SECTION003870050000000000000">
Somehow get the static File daemon loaded on your system</A>
</H4>
Put the static file daemon and its conf file in /tmp.

<P>

<H4><A NAME="SECTION003870060000000000000">
Restore and Start the File Daemon:</A>
</H4>
<PRE>
chroot /mnt/disk /tmp/bacula-fd -c /tmp/bacula-fd.conf
</PRE>
<P>
The above command starts the Bacula File daemon with the proper root disk
location (i.e. <B>/mnt/disk/tmp</B>. If Bacula does not start, correct the
problem and start it. You can check if it is running by entering: 

<P>
<PRE>
ps fax
</PRE>
<P>
You can kill Bacula by entering: 

<P>
<PRE>
kill -TERM &lt;pid&gt;
</PRE>
<P>
where <B>pid</B> is the first number printed in front of the first occurrence
of <B>bacula-fd</B> in the <B>ps fax</B> command. 

<P>
Now, you should be able to use another computer with Bacula installed to check
the status by entering: 

<P>
<PRE>
status client=xxxx
</PRE>
<P>
into the Console program, where xxxx is the name of the client you are
restoring. 

<P>
One common problem is that your <B>bacula-dir.conf</B> may contain machine
addresses that are not properly resolved on the stripped down system to be
restored because it is not running DNS. This is particularly true for the
address in the Storage resource of the Director, which may be very well
resolved on the Director's machine, but not on the machine being restored and
running the File daemon. In that case, be prepared to edit <B>bacula-dir.conf</B> to replace the name of the Storage daemon's domain name with
its IP address. 

<P>

<H4><A NAME="SECTION003870070000000000000">
Restore Your Files:</A>
</H4>

<P>
On the computer that is running the Director, you now run a <B>restore</B>
command and select the files to be restored (normally everything), but before
starting the restore, there is one final change you must make using the <B>mod</B> option. You must change the <B>Where</B> directory to be the root by using
the <B>mod</B> option just before running the job and selecting <B>Where</B>.
Set it to: 

<P>
<PRE>
/
</PRE>
<P>
then run the restore. 

<P>
You might be tempted to avoid using <B>chroot</B> and running Bacula directly
and then using a <B>Where</B> to specify a destination of <B>/mnt/disk</B>. This
is possible, however, the current version of Bacula always restores files to
the new location, and thus any soft links that have been specified with
absolute paths will end up with <B>/mnt/disk</B> prefixed to them. In general
this is not fatal to getting your system running, but be aware that you will
have to fix these links if you do not use <B>chroot</B>. 

<P>

<H4><A NAME="SECTION003870080000000000000">
Final Step:</A>
</H4>

<P>
<PRE>
/sbin/grub-install --root-directory=/mnt/disk /dev/hda
</PRE>
<P>
Note, in this case, you omit the chroot command, and you must
replace /dev/hda with your boot device.  If you don't know what your
boot device is, run the ./run_grub script once and it will tell
you.

<P>
Finally, I've even run into a case where grub-install was unable to
rewrite the boot block. In my case, it produced the following error
message:

<P>
<PRE>
/dev/hdx does not have any corresponding BIOS drive.
</PRE>
<P>
The solution is to insure that all your disks are properly mounted on
/mnt/disk, then do the following:

<P>
<PRE>
chroot /mnt/disk
mount /dev/pts
</PRE>
<P>
Then edit the file <B>/boot/grub/grub.conf</B> and uncomment the line
that reads:

<P>
<PRE>
#boot=/dev/hda
</PRE>
<P>
So that it reads:

<P>
<PRE>
boot=/dev/hda
</PRE>
<P>
Note, the /dev/hda may be /dev/sda or possibly some other drive depending
on your configuration, but in any case, it is the same as the one that
you previously tried with <B>grub-install</B>.

<P>
Then, enter the following commands:

<P>
<PRE>
grub --batch --device-map=/boot/grub/device.map \
  --config-file=/boot/grub/grub.conf --no-floppy
root (hd0,0)
setup (hd0)
quit
</PRE>
<P>
If the <B>grub</B> call worked, you will get a prompt of <B>grub</B>   
before the <B>root</B>, <B>setup</B>, and <B>quit</B> commands, and after 
entering the <B>setup</B> command, it should indicate that it successfully
wrote the MBR (master boot record).

<P>

<H4><A NAME="SECTION003870090000000000000">
Reboot:</A>
</H4>

<P>
First unmount all your hard disks, otherwise they will not be cleanly
shutdown, then reboot your machine by entering <B>exit</B> until you get to the
main prompt then enter <B>Ctrl-d</B>. Once back to the main CDROM prompt, you
will need to turn the power off, then back on to your machine to get it to
reboot. 

<P>
If everything went well, you should now be back up and running. If not,
re-insert the emergency boot CDROM, boot, and figure out what is wrong. 

<P>
<A NAME="restore_server"></A>
<H1><A NAME="SECTION003880000000000000000">
Restoring a Server</A>
</H1>
<A NAME="19242"></A>
<A NAME="19243"></A>

<P>
Above, we considered how to recover a client machine where a valid Bacula
server was running on another machine. However, what happens if your server
goes down and you no longer have a running Director, Catalog, or Storage
daemon? There are several solutions: 

<P>

<OL>
<LI>Bring up static versions of your Director, Catalog, and Storage  daemon 
   on the damaged machine.

<P>
</LI>
<LI>Move your server to another machine. 

<P>
</LI>
<LI>Use a Hot Spare Server on another Machine.
</LI>
</OL>

<P>
The first option, is very difficult because it requires you to have created a
static version of the Director and the Storage daemon as well as the Catalog.
If the Catalog uses MySQL or PostgreSQL, this may or may not be possible. In
addition, to loading all these programs on a bare system (quite possible), you
will need to make sure you have a valid driver for your tape drive. 

<P>
The second suggestion is probably a much simpler solution, and one I have done
myself. To do so, you might want to consider the following steps: 

<P>

<UL>
<LI>If you are using MySQL or PostgreSQL, configure, build and install it
   from source (or use rpms) on your new system.  
</LI>
<LI>Load the Bacula source code onto your new system, configure,  install
   it, and create the Bacula database.  
</LI>
<LI>Ideally, you will have a copy of all the Bacula conf files that
   were being used on your server. If not, you will at a minimum need
   create a bacula-dir.conf that has the same Client resource that
   was used to backup your system.
</LI>
<LI>If you have a valid saved Bootstrap file as created for your  damaged
   machine with WriteBootstrap, use it to restore the files to the damaged
   machine, where you have loaded a static Bacula File daemon using the
   Rescue disk).  This is done by using the restore command and at
   the yes/mod/no prompt, selecting <B>mod</B> then specifying the path to
   the bootstrap file.
</LI>
<LI>If you have the Bootstrap file, you should now be back up and  running,
   if you do not have a Bootstrap file, continue with the  suggestions below.  
</LI>
<LI>Using <B>bscan</B> scan the last set of backup tapes into your  MySQL,
   PostgreSQL or SQLite database.  
</LI>
<LI>Start Bacula, and using the Console <B>restore</B> command,  restore the
   last valid copy of the Bacula database and the Bacula configuration
   files.  
</LI>
<LI>Move the database to the correct location. 
</LI>
<LI>Start the database, and restart Bacula. Then use the Console <B>   restore</B> command, restore all the files  on the damaged machine, where you
   have loaded a Bacula File  daemon using the Rescue disk. 
</LI>
</UL>

<P>
For additional details of restoring your database, please see the
Restoring When Things Go Wrongdatabase_restore section
of the Console Restore Command chapter of this manual.

<P>
<A NAME="problems2"></A>
<H1><A NAME="SECTION003890000000000000000">
Linux Problems or Bugs</A>
</H1>
<A NAME="19256"></A>
<A NAME="19257"></A>

<P>
Since every flavor and every release of Linux is different, there are likely
to be some small difficulties with the scripts, so please be prepared to edit
them in a minimal environment. A rudimentary knowledge of <B>vi</B> is very
useful. Also, these scripts do not do everything. You will need to reformat
Windows partitions by hand, for example. 

<P>
Getting the boot loader back can be a problem if you are using <B>grub</B>
because it is so complicated. If all else fails, reboot your system from your
floppy but using the restored disk image, then proceed to a reinstallation of
grub (looking at the run-grub script can help). By contrast, lilo is a piece
of cake. 

<P>
<A NAME="LiveCD"></A>
<H1><A NAME="SECTION0038100000000000000000">
Bare Metal Recovery using a LiveCD</A>
</H1>
<A NAME="19262"></A>
<A NAME="19263"></A>
<A NAME="19264"></A>
<A NAME="19265"></A>

<P>
As an alternative to the old now defunct Bacula Rescue CDROM, you can use any
system rescue or LiveCD to recover your system. The big problem
with most rescue or LiveCDs is that they are not designed to
capture the current state of your system, so when you boot them on
a damaged system, you might be somewhat lost - e.g. how many of
you remember your exact hard disk partitioning.

<P>
This lack can be easily corrected by running the part of the
Bacula Rescue code that creates a directory containing a   
static-bacula-fd, a snapshot of your current system disk
configuration, and scripts that help restoring it.

<P>
Before a disaster strikes:

<OL>
<LI>Run only the <B>make bacula</B> part of the
  Bacula Rescue procedure to create the static Bacula
  File daemon, and system disk snapshot. 
</LI>
<LI>Save the directory generated (more details below)
  preferrably on a CDROM or alternatively to some other
  system.
</LI>
<LI>Possibly run <B>make bacula</B> every night as
  part of your backup process to ensure that you have
  a current snapshot of your system.
</LI>
</OL>

<P>
Then when disaster strikes, do the following:

<P>

<OL>
<LI>Boot with your system rescue disk or LiveCD
   (e.g. Knoppix).
</LI>
<LI>Start the Network (local network).  
</LI>
<LI>Copy the Bacula recovery directory to the 
   damaged system using ftp, scp, wget or if your
   boot disk permits it reading it directly from a
   CDROM.
</LI>
<LI>Continue as documented above.
</LI>
<LI>Re-partition your hard disk(s) as it was before,  
   if necessary.
</LI>
<LI>Re-format your partitions, if necessary.  
</LI>
<LI>Restore the Bacula File daemon (static version).  
</LI>
<LI>Perform a Bacula restore of all your files.  
</LI>
<LI>Re-install your boot loader.  
</LI>
<LI>Reboot. 
</LI>
</OL>

<P>
In order to create the Bacula recovery directory, you need
a copy of the Bacula Rescue code as described above, and
you must first configure that directory.

<P>
Once the configuration is done, you can do the following
to create the Bacula recovery directory:

<P>
<PRE>
cd &lt;bacula-rescue-source&gt;/linux/cdrom
su (become root)
make bacula
</PRE>
<P>
The directory you want to save will be created in
the current directory with the name <B>bacula</B>.  You
need only save that directory either as a directory or
possibly as a compressed tar file.  If you run this procedure
on multiple machines, you will probably want to rename this directory
to something like <B>bacula-hostname</B>.

<P>
<A NAME="FreeBSD1"></A>
<H1><A NAME="SECTION0038110000000000000000">
FreeBSD Bare Metal Recovery</A>
</H1>
<A NAME="19278"></A>
<A NAME="19279"></A>
<A NAME="19280"></A>

<P>
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: 

<P>

<OL>
<LI>Boot with the FreeBSD installation disk 
</LI>
<LI>Go to Custom, Partition and create your slices and go to Label and 
   create the partitions that you want. Apply changes. 
</LI>
<LI>Go to Fixit to start an emergency console. 
</LI>
<LI>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 first SCSI drive.  Under
OS version 5 and greater, your device files are  most likely automatically
created for you. 
</LI>
<LI>mkdir /mnt/disk
   this is the root of the new disk 
</LI>
<LI>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. 
</LI>
<LI>Network configuration (ifconfig xl0 ip/mask + route add default 
   ip-gateway) 
</LI>
<LI>mkdir /mnt/disk/tmp 
</LI>
<LI>cd /mnt/disk/tmp 
</LI>
<LI>Copy bacula-fd and bacula-fd.conf to this path 
</LI>
<LI>If you need to, use sftp to copy files, after which you must do this:
   ln -s /mnt2/usr/bin /usr/bin 
</LI>
<LI>chmod u+x bacula-fd 
</LI>
<LI>Modify bacula-fd.conf to fit this machine 
</LI>
<LI>Copy /bin/sh to /mnt/disk, necessary for chroot 
</LI>
<LI>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. 
</LI>
<LI>mkdir -p /mnt/disk/var/db/bacula 
</LI>
<LI>chroot /mnt/disk /tmp/bacula-fd -c /tmp/bacula-fd.conf
   to start bacula-fd 
</LI>
<LI>Now you can go to bacula-dir and restore the job with the entire 
   contents of the broken server. 
</LI>
<LI>You must create /proc 
</LI>
</OL>

<P>
<A NAME="solaris"></A>
<H1><A NAME="SECTION0038120000000000000000">
Solaris Bare Metal Recovery</A>
</H1>
<A NAME="19285"></A>
<A NAME="19286"></A>

<P>
The same basic techniques described above apply to Solaris: 

<P>

<UL>
<LI>the same restrictions as those given for Linux apply  
</LI>
<LI>you will need to create a Rescue disk 
   
</LI>
</UL>

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

<P>

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

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

<P>

<H1><A NAME="SECTION0038130000000000000000">
Preparing Solaris Before a Disaster</A>
</H1>
<A NAME="19292"></A>
<A NAME="19293"></A>

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

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

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

<P>

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

<P>
<A NAME="genbugs"></A>
<P>

<H1><A NAME="SECTION0038140000000000000000">
Bugs and Other Considerations</A>
</H1>
<A NAME="19308"></A>
<A NAME="19309"></A>

<P>

<H4><A NAME="SECTION0038140010000000000000">
Directory Modification and Access Times are Modified on pre-1.30
Baculas :</A>
</H4>

<P>
When a pre-1.30 version of Bacula restores a directory, it first must create
the directory, then it populates the directory with its files and
subdirectories. The act of creating the files and subdirectories updates both
the modification and access times associated with the directory itself. As a
consequence, all modification and access times of all directories will be
updated to the time of the restore. 

<P>
This has been corrected in Bacula version 1.30 and later. The directory
modification and access times are reset to the value saved in the backup after
all the files and subdirectories have been restored. This has been tested and
verified on normal restore operations, but not verified during a bare metal
recovery. 

<P>

<H4><A NAME="SECTION0038140020000000000000">
Strange Bootstrap Files:</A>
</H4>

<P>
If any of you look closely at the bootstrap file that is produced and used for
the restore (I sure do), you will probably notice that the FileIndex item does
not include all the files saved to the tape. This is because in some instances
there are duplicates (especially in the case of an Incremental save), and in
such circumstances, <B>Bacula</B> restores only the last of multiple copies of
a file or directory. 

<P>
<A NAME="Win3233"></A>
<H1><A NAME="SECTION0038150000000000000000">
Disaster Recovery of Win32 Systems</A>
</H1>
<A NAME="19315"></A>
<A NAME="19316"></A>

<P>
Due to open system files, and registry problems, Bacula cannot save and
restore a complete Win2K/XP/NT environment. 

<P>
A suggestion by Damian Coutts using Microsoft's NTBackup utility in
conjunction with Bacula should permit a Full bare metal restore of Win2K/XP
(and possibly NT systems). His suggestion is to do an NTBackup of the critical
system state prior to running a Bacula backup with the following command: 

<P>
<PRE>
ntbackup backup systemstate /F c:\systemstate.bkf
</PRE>
<P>
The <B>backup</B> is the command, the <B>systemstate</B> says to backup only the
system state and not all the user files, and the <B>/F
c:&#92;systemstate.bkf</B> specifies where to write the state file.
this file must then be saved and restored by Bacula. This command
can be put in a Client Run Before Job directive so that it is automatically
run during each backup, and thus saved to a Bacula Volume.

<P>
To restore the system state, you first reload a base operating system, then
you would use Bacula to restore all the users files and to recover the <B>c:&#92;systemstate.bkf</B> file, and finally, run <B>NTBackup</B> and
<B>catalogue</B> the system statefile, and then select it for restore. The
documentation says you can't run a command line restore of the systemstate. 

<P>
This procedure has been confirmed to work by Ludovic Strappazon - many
thanks! 

<P>
A new tool is provided in the form of a bacula plugin for the BartPE rescue
CD. BartPE is a self-contained WindowsXP boot CD which you can make using the
PeBuilder tools available at 
http://www.nu2.nu/pebuilder/http://www.nu2.nu/pebuilder/ and a valid
Windows XP SP1 CDROM. The plugin is provided as a zip archive. Unzip the file
and copy the bacula directory into the plugin directory of your BartPE
installation. Edit the configuration files to suit your installation and build
your CD according to the instructions at Bart's site. This will permit you to
boot from the cd, configure and start networking, start the bacula file client
and access your director with the console program. The programs menu on the
booted CD contains entries to install the file client service, start the file
client service, and start the WX-Console. You can also open a command line
window and CD Programs&#92;Bacula and run the command line console
bconsole. 

<P>

<H1><A NAME="SECTION0038160000000000000000">
Ownership and Permissions on Win32 Systems</A>
</H1>
<A NAME="19329"></A>
<A NAME="19330"></A>

<P>
Bacula versions after 1.31 should properly restore ownership and permissions
on all WinNT/XP/2K systems. If you do experience problems, generally in
restores to alternate directories because higher level directories were not
backed up by Bacula, you can correct any problems with the <B>SetACL</B>
available under the GPL license at: 
http://sourceforge.net/projects/setacl/http://sourceforge.net/projects/setacl/. 

<P>

<H1><A NAME="SECTION0038170000000000000000">
Alternate Disaster Recovery Suggestion for Win32 Systems</A>
</H1>
<A NAME="19335"></A>
<A NAME="19336"></A>

<P>
Ludovic Strappazon has suggested an interesting way to backup and restore
complete Win32 partitions. Simply boot your Win32 system with a Linux Rescue
disk as described above for Linux, install a statically linked Bacula, and
backup any of the raw partitions you want. Then to restore the system, you
simply restore the raw partition or partitions. Here is the email that Ludovic
recently sent on that subject: 

<P>
<PRE>
I've just finished testing my brand new cd LFS/Bacula
with a raw Bacula backup and restore of my portable.
I can't resist sending you the results: look at the rates !!!
hunt-dir: Start Backup JobId 100, Job=HuntBackup.2003-04-17_12.58.26
hunt-dir: Bacula 1.30 (14Apr03): 17-Apr-2003 13:14
JobId:                  100
Job:                    HuntBackup.2003-04-17_12.58.26
FileSet:                RawPartition
Backup Level:           Full
Client:                 sauvegarde-fd
Start time:             17-Apr-2003 12:58
End time:               17-Apr-2003 13:14
Files Written:          1
Bytes Written:          10,058,586,272
Rate:                   10734.9 KB/s
Software Compression:   None
Volume names(s):        000103
Volume Session Id:      2
Volume Session Time:    1050576790
Last Volume Bytes:      10,080,883,520
FD termination status:  OK
SD termination status:  OK
Termination:            Backup OK
hunt-dir: Begin pruning Jobs.
hunt-dir: No Jobs found to prune.
hunt-dir: Begin pruning Files.
hunt-dir: No Files found to prune.
hunt-dir: End auto prune.
hunt-dir: Start Restore Job RestoreFilesHunt.2003-04-17_13.21.44
hunt-sd: Forward spacing to file 1.
hunt-dir: Bacula 1.30 (14Apr03): 17-Apr-2003 13:54
JobId:                  101
Job:                    RestoreFilesHunt.2003-04-17_13.21.44
Client:                 sauvegarde-fd
Start time:             17-Apr-2003 13:21
End time:               17-Apr-2003 13:54
Files Restored:         1
Bytes Restored:         10,056,130,560
Rate:                   5073.7 KB/s
FD termination status:  OK
Termination:            Restore OK
hunt-dir: Begin pruning Jobs.
hunt-dir: No Jobs found to prune.
hunt-dir: Begin pruning Files.
hunt-dir: No Files found to prune.
hunt-dir: End auto prune.
</PRE>
<P>
<A NAME="running"></A>
<P>

<H1><A NAME="SECTION0038180000000000000000">
Restoring to a Running System</A>
</H1>
<A NAME="19341"></A>
<A NAME="19342"></A>

<P>
If for some reason you want to do a Full restore to a system that has a
working kernel (not recommended), you will need to take care not to
overwrite the following files:

<P>
<PRE>
/etc/grub.conf
/etc/X11/Conf
/etc/fstab
/etc/mtab
/lib/modules
/usr/modules
/usr/X11R6
/etc/modules.conf
</PRE>
<P>
<A NAME="Resources"></A>
<P>

<H1><A NAME="SECTION0038190000000000000000">
Additional Resources</A>
</H1>
<A NAME="19347"></A>
<A NAME="19348"></A>

<P>
Many thanks to Charles Curley who wrote 
Linux Complete Backup and Recovery HOWTO
http://www.tldp.org/HOWTO/Linux-Complete-Backup-and-Recovery-HOWTO/index.html for the 
The Linux Documentation Projecthttp://www.tldp.org/. This is an
excellent document on how to do Bare Metal Recovery on Linux systems, and it
was this document that made me realize that Bacula could do the same thing. 

<P>
You can find quite a few additional resources, both commercial and free at 
Storage Mountainhttp://www.backupcentral.com, formerly known as
Backup Central. 

<P>
And finally, the O'Reilly book, "Unix Backup &amp; Recovery" by W. Curtis
Preston covers virtually every backup and recovery topic including bare metal
recovery for a large range of Unix systems. 

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1847"
  HREF="Bacula_TLS_Communications.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1841"
  HREF="Bacula_Main_Reference.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1835"
  HREF="Windows_Version_Bacula.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1843"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1845"
  HREF="Thanks.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1848"
  HREF="Bacula_TLS_Communications.html">Bacula TLS - Communications</A>
<B> Up:</B> <A NAME="tex2html1842"
  HREF="Bacula_Main_Reference.html">Bacula Main Reference</A>
<B> Previous:</B> <A NAME="tex2html1836"
  HREF="Windows_Version_Bacula.html">The Windows Version of</A>
 &nbsp; <B>  <A NAME="tex2html1844"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1846"
  HREF="Thanks.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>