1%%
2%%
3
4\chapter{Disaster Recovery Using Bacula}
5\label{RescueChapter}
6\index[general]{Disaster Recovery Using Bacula}
7\index[general]{Bacula!Disaster Recovery Using}
8\index[general]{Recovery!Disaster Recovery}
9\index[general]{Rescue!Disaster Recovery}
10
11\section{General}
12\index[general]{General}
13
14When disaster strikes, you must have a plan, and you must have prepared in
15advance otherwise the work of recovering your system and your files will be
16considerably greater.  For example, if you have not previously saved the
17partitioning information for your hard disk, how can you properly rebuild
18it if the disk must be replaced?
19
20Unfortunately, many of the steps one must take before and immediately after
21a disaster are very operating system dependent.  As a consequence, this
22chapter will discuss in detail disaster recovery (also called Bare Metal
23Recovery) for {\bf Linux} and {\bf Solaris}.  For Solaris, the procedures
24are still quite manual.  For FreeBSD the same procedures may be used but
25they are not yet developed.  For Win32, a number of Bacula users have
26reported success using BartPE.
27
28
29\label{considerations1}
30\section{Important Considerations}
31\index[general]{Important Considerations}
32\index[general]{Considerations!Important}
33
34Here are a few important considerations concerning disaster recovery that
35you should take into account before a disaster strikes.
36
37\begin{itemize}
38\item If the building which houses your computers burns down or is otherwise
39   destroyed, do you have off-site backup data?
40\item Disaster recovery is much easier if you have several machines. If  you
41   have a single machine, how will you handle unforeseen events  if your only
42   machine is down?
43\item Do you want to protect your whole system and use Bacula to  recover
44   everything? or do you want to try to restore your system from  the original
45   installation disks and apply any other updates and  only restore user files?
46\end{itemize}
47
48\label{steps1}
49\section{Steps to Take Before Disaster Strikes}
50\index[general]{Steps to Take Before Disaster Strikes}
51\index[general]{Strikes!Steps to Take Before Disaster}
52
53\begin{itemize}
54\item Create a rescue or CDROM for each of your Linux systems. Generally,
55   they are offered by each distribution, and there are many good
56   rescue disks on the Web (Knoppix, sysrescuecd, PLD Linux rescue CD,
57   tomsrtbt, RIP ...
58
59\item Create a bacula-hostname directory on
60   each machine and save it somewhere -- possibly on a USB key.
61\item Ensure that you always have a valid bootstrap file for your backup and
62   that it is saved to an alternate machine.  This will permit you to
63   easily do a full restore of your system.
64\item If possible copy your catalog nightly to an alternate machine.  If you
65   have a valid bootstrap file, this is not necessary, but  can be very useful if
66   you do not want to reload everything. .
67\item Ensure that you always have a valid bootstrap file for your  catalog
68   backup that is saved to an alternate machine. This will  permit you to restore
69   your catalog more easily if needed.
70\item Test using the Rescue CDROM before you are forced to use it in
71   an emergency situation.
72\item Make a copy of your Bacula .conf files, particularly your
73   bacula-dir.conf, and your bacula-sd.conf files, because if your server
74   goes down, these files will be needed to get it back up and running,
75   and they can be difficult to rebuild from memory.
76\end{itemize}
77
78\label{rescueCDROM}
79\section{Bare Metal Recovery on Linux with a Rescue CD}
80\index[general]{Bare Metal Recovery on Linux with a Rescue CD}
81\index[general]{CDROM!Bare Metal Recovery on Linux with a Rescue}
82
83As an alternative to creating a Rescue CD, please see the
84section below entitled \ilink{Bare Metal Recovery using a LiveCD}{LiveCD}.
85
86Bacula previously had a Rescue CD.  Unfortunately, this CD did not work
87on every Linux Distro, and in addition, Linux is evolving with different
88boot methods, more and more complex hardware configurations (LVM, RAID,
89WiFi, USB, ...).  As a consequence, the Bacula Rescue CD as it was
90originally envisioned no longer exists.
91
92However there are many other good rescue disks available.
93A so called "Bare Metal" recovery is one where you start with an empty hard
94disk and you restore your machine. There are also cases where you may lose a
95file or a directory and want it restored. Please see the previous chapter for
96more details for those cases.
97
98Bare Metal Recovery assumes that you have the following items for your system:
99
100\begin{itemize}
101\item A Rescue CDROM containing a copy of your OS.
102\item Perhaps a copy of your
103   hard disk information, as well as a statically linked version of the
104   Bacula File daemon.
105\item A full Bacula backup of your system possibly including  Incremental or
106   Differential backups since the last Full  backup
107\item A second system running the Bacula Director, the Catalog, and the
108   Storage daemon.  (this is not an absolute requirement, but how to get
109   around it is not yet documented here)
110\end{itemize}
111
112\section{Requirements}
113\index[general]{Requirements}
114
115
116\label{restore_client}
117\section{Restoring a Client System}
118\index[general]{Restoring a Client System}
119\index[general]{System!Restoring a Client}
120
121Now, let's assume that your hard disk has just died and that you have replaced
122it with an new identical drive. In addition, we assume that you have:
123
124\begin{enumerate}
125\item A recent Bacula backup (Full plus Incrementals)
126\item A Rescue CDROM.
127\item Your Bacula Director, Catalog, and Storage daemon running  on another
128   machine on your local network.
129\end{enumerate}
130
131This is a relatively simple case, and later in this chapter, as time permits,
132we will discuss how you might recover from a situation where the machine that
133crashes is your main Bacula server (i.e. has the Director, the Catalog, and
134the Storage daemon).
135
136You will take the following steps to get your system back up and running:
137
138\begin{enumerate}
139\item Boot with your Rescue CDROM.
140\item Start the Network (local network)
141\item Re-partition your hard disk(s) as it was before
142\item Re-format your partitions
143\item Restore the Bacula File daemon (static version)
144\item Perform a Bacula restore of all your files
145\item Re-install your boot loader
146\item Reboot
147\end{enumerate}
148
149Now for the details ...
150
151\section{Boot with your Rescue CDROM}
152\index[general]{CDROM!Boot with your Rescue}
153\index[general]{Boot with your Rescue CDROM}
154
155Each rescue disk boots somewhat differently.  Please see the
156instructions that go with your CDROM.
157
158
159\paragraph*{Start the Network:}
160
161\normalsize
162
163You can test it by pinging another machine, or pinging your broken machine
164machine from another machine. Do not proceed until your network is up.
165
166\paragraph*{Partition Your Hard Disk(s):}
167
168\paragraph*{Format Your Hard Disk(s):}
169
170\paragraph*{Mount the Newly Formatted Disks:}
171
172
173\paragraph*{Somehow get the static File daemon loaded on your system}
174Put the static file daemon and its conf file in /tmp.
175
176\paragraph*{Restore and Start the File Daemon:}
177\footnotesize
178\begin{verbatim}
179chroot /mnt/disk /tmp/bacula-fd -c /tmp/bacula-fd.conf
180\end{verbatim}
181\normalsize
182
183The above command starts the Bacula File daemon with the proper root disk
184location (i.e. {\bf /mnt/disk/tmp}. If Bacula does not start, correct the
185problem and start it. You can check if it is running by entering:
186
187\footnotesize
188\begin{verbatim}
189ps fax
190\end{verbatim}
191\normalsize
192
193You can kill Bacula by entering:
194
195\footnotesize
196\begin{verbatim}
197kill -TERM <pid>
198\end{verbatim}
199\normalsize
200
201where {\bf pid} is the first number printed in front of the first occurrence
202of {\bf bacula-fd} in the {\bf ps fax} command.
203
204Now, you should be able to use another computer with Bacula installed to check
205the status by entering:
206
207\footnotesize
208\begin{verbatim}
209status client=xxxx
210\end{verbatim}
211\normalsize
212
213into the Console program, where xxxx is the name of the client you are
214restoring.
215
216One common problem is that your {\bf bacula-dir.conf} may contain machine
217addresses that are not properly resolved on the stripped down system to be
218restored because it is not running DNS. This is particularly true for the
219address in the Storage resource of the Director, which may be very well
220resolved on the Director's machine, but not on the machine being restored and
221running the File daemon. In that case, be prepared to edit {\bf
222bacula-dir.conf} to replace the name of the Storage daemon's domain name with
223its IP address.
224
225\paragraph*{Restore Your Files:}
226
227On the computer that is running the Director, you now run a {\bf restore}
228command and select the files to be restored (normally everything), but before
229starting the restore, there is one final change you must make using the {\bf
230mod} option. You must change the {\bf Where} directory to be the root by using
231the {\bf mod} option just before running the job and selecting {\bf Where}.
232Set it to:
233
234\footnotesize
235\begin{verbatim}
236/
237\end{verbatim}
238\normalsize
239
240then run the restore.
241
242You might be tempted to avoid using {\bf chroot} and running Bacula directly
243and then using a {\bf Where} to specify a destination of {\bf /mnt/disk}. This
244is possible, however, the current version of Bacula always restores files to
245the new location, and thus any soft links that have been specified with
246absolute paths will end up with {\bf /mnt/disk} prefixed to them. In general
247this is not fatal to getting your system running, but be aware that you will
248have to fix these links if you do not use {\bf chroot}.
249
250\paragraph*{Final Step:}
251
252
253
254\footnotesize
255\begin{verbatim}
256/sbin/grub-install --root-directory=/mnt/disk /dev/hda
257\end{verbatim}
258\normalsize
259
260Note, in this case, you omit the chroot command, and you must
261replace /dev/hda with your boot device.  If you don't know what your
262boot device is, run the ./run\_grub script once and it will tell
263you.
264
265Finally, I've even run into a case where grub-install was unable to
266rewrite the boot block. In my case, it produced the following error
267message:
268
269\footnotesize
270\begin{verbatim}
271/dev/hdx does not have any corresponding BIOS drive.
272\end{verbatim}
273\normalsize
274
275The solution is to insure that all your disks are properly mounted on
276/mnt/disk, then do the following:
277
278\footnotesize
279\begin{verbatim}
280chroot /mnt/disk
281mount /dev/pts
282\end{verbatim}
283\normalsize
284
285Then edit the file {\bf /boot/grub/grub.conf} and uncomment the line
286that reads:
287
288\footnotesize
289\begin{verbatim}
290#boot=/dev/hda
291\end{verbatim}
292\normalsize
293
294So that it reads:
295
296\footnotesize
297\begin{verbatim}
298boot=/dev/hda
299\end{verbatim}
300\normalsize
301
302Note, the /dev/hda may be /dev/sda or possibly some other drive depending
303on your configuration, but in any case, it is the same as the one that
304you previously tried with {\bf grub-install}.
305
306Then, enter the following commands:
307
308\footnotesize
309\begin{verbatim}
310grub --batch --device-map=/boot/grub/device.map \
311  --config-file=/boot/grub/grub.conf --no-floppy
312root (hd0,0)
313setup (hd0)
314quit
315\end{verbatim}
316\normalsize
317
318If the {\bf grub} call worked, you will get a prompt of {\bf grub\gt{}}
319before the {\bf root}, {\bf setup}, and {\bf quit} commands, and after
320entering the {\bf setup} command, it should indicate that it successfully
321wrote the MBR (master boot record).
322
323
324\paragraph*{Reboot:}
325
326First unmount all your hard disks, otherwise they will not be cleanly
327shutdown, then reboot your machine by entering {\bf exit} until you get to the
328main prompt then enter {\bf Ctrl-d}. Once back to the main CDROM prompt, you
329will need to turn the power off, then back on to your machine to get it to
330reboot.
331
332If everything went well, you should now be back up and running. If not,
333re-insert the emergency boot CDROM, boot, and figure out what is wrong.
334
335\label{restore_server}
336\section{Restoring a Server}
337\index[general]{Restoring a Server}
338\index[general]{Server!Restoring a}
339
340Above, we considered how to recover a client machine where a valid Bacula
341server was running on another machine. However, what happens if your server
342goes down and you no longer have a running Director, Catalog, or Storage
343daemon? There are several solutions:
344
345\begin{enumerate}
346\item Bring up static versions of your Director, Catalog, and Storage  daemon
347   on the damaged machine.
348
349\item Move your server to another machine.
350
351\item Use a Hot Spare Server on another Machine.
352\end{enumerate}
353
354The first option, is very difficult because it requires you to have created a
355static version of the Director and the Storage daemon as well as the Catalog.
356If the Catalog uses MySQL or PostgreSQL, this may or may not be possible. In
357addition, to loading all these programs on a bare system (quite possible), you
358will need to make sure you have a valid driver for your tape drive.
359
360The second suggestion is probably a much simpler solution, and one I have done
361myself. To do so, you might want to consider the following steps:
362
363\begin{itemize}
364\item If you are using MySQL or PostgreSQL, configure, build and install it
365   from source (or use rpms) on your new system.
366\item Load the Bacula source code onto your new system, configure,  install
367   it, and create the Bacula database.
368\item Ideally, you will have a copy of all the Bacula conf files that
369   were being used on your server. If not, you will at a minimum need
370   create a bacula-dir.conf that has the same Client resource that
371   was used to backup your system.
372\item If you have a valid saved Bootstrap file as created for your  damaged
373   machine with WriteBootstrap, use it to restore the files to the damaged
374   machine, where you have loaded a static Bacula File daemon using the
375   Rescue disk).  This is done by using the restore command and at
376   the yes/mod/no prompt, selecting {\bf mod} then specifying the path to
377   the bootstrap file.
378\item If you have the Bootstrap file, you should now be back up and  running,
379   if you do not have a Bootstrap file, continue with the  suggestions below.
380\item Using {\bf bscan} scan the last set of backup tapes into your  MySQL,
381   PostgreSQL or SQLite database.
382\item Start Bacula, and using the Console {\bf restore} command,  restore the
383   last valid copy of the Bacula database and the Bacula configuration
384   files.
385\item Move the database to the correct location.
386\item Start the database, and restart Bacula. Then use the Console {\bf
387   restore} command, restore all the files  on the damaged machine, where you
388   have loaded a Bacula File  daemon using the Rescue disk.
389\end{itemize}
390
391For additional details of restoring your database, please see the
392\ilink{Restoring When Things Go Wrong}{database_restore} section
393of the Console Restore Command chapter of this manual.
394
395
396\label{problems2}
397\section{Linux Problems or Bugs}
398\index[general]{Bugs!Linux Problems or}
399\index[general]{Linux Problems or Bugs}
400
401Since every flavor and every release of Linux is different, there are likely
402to be some small difficulties with the scripts, so please be prepared to edit
403them in a minimal environment. A rudimentary knowledge of {\bf vi} is very
404useful. Also, these scripts do not do everything. You will need to reformat
405Windows partitions by hand, for example.
406
407Getting the boot loader back can be a problem if you are using {\bf grub}
408because it is so complicated. If all else fails, reboot your system from your
409floppy but using the restored disk image, then proceed to a reinstallation of
410grub (looking at the run-grub script can help). By contrast, lilo is a piece
411of cake.
412
413\label{LiveCD}
414\section{Bare Metal Recovery using a LiveCD}
415\index[general]{Bare Metal Recovery using a LiveCD}
416\index[general]{Recovery!Bare Metal Recovery using a LiveCD}
417\index[general]{Rescue!Bare Metal Recovery using a LiveCD}
418\index[general]{LiveCD!Bare Metal Recovery using a LiveCD}
419
420As an alternative to the old now defunct Bacula Rescue CDROM, you can use any
421system rescue or LiveCD to recover your system. The big problem
422with most rescue or LiveCDs is that they are not designed to
423capture the current state of your system, so when you boot them on
424a damaged system, you might be somewhat lost -- e.g. how many of
425you remember your exact hard disk partitioning.
426
427This lack can be easily corrected by running the part of the
428Bacula Rescue code that creates a directory containing a
429static-bacula-fd, a snapshot of your current system disk
430configuration, and scripts that help restoring it.
431
432Before a disaster strikes:
433\begin{enumerate}
434\item Run only the {\bf make bacula} part of the
435  Bacula Rescue procedure to create the static Bacula
436  File daemon, and system disk snapshot.
437\item Save the directory generated (more details below)
438  preferrably on a CDROM or alternatively to some other
439  system.
440\item Possibly run {\bf make bacula} every night as
441  part of your backup process to ensure that you have
442  a current snapshot of your system.
443\end{enumerate}
444
445Then when disaster strikes, do the following:
446
447\begin{enumerate}
448\item Boot with your system rescue disk or LiveCD
449   (e.g. Knoppix).
450\item Start the Network (local network).
451\item Copy the Bacula recovery directory to the
452   damaged system using ftp, scp, wget or if your
453   boot disk permits it reading it directly from a
454   CDROM.
455\item Continue as documented above.
456\item Re-partition your hard disk(s) as it was before,
457   if necessary.
458\item Re-format your partitions, if necessary.
459\item Restore the Bacula File daemon (static version).
460\item Perform a Bacula restore of all your files.
461\item Re-install your boot loader.
462\item Reboot.
463\end{enumerate}
464
465In order to create the Bacula recovery directory, you need
466a copy of the Bacula Rescue code as described above, and
467you must first configure that directory.
468
469Once the configuration is done, you can do the following
470to create the Bacula recovery directory:
471
472\footnotesize
473\begin{verbatim}
474cd <bacula-rescue-source>/linux/cdrom
475su (become root)
476make bacula
477\end{verbatim}
478\normalsize
479
480The directory you want to save will be created in
481the current directory with the name {\bf bacula}.  You
482need only save that directory either as a directory or
483possibly as a compressed tar file.  If you run this procedure
484on multiple machines, you will probably want to rename this directory
485to something like {\bf bacula-hostname}.
486
487
488
489\label{FreeBSD1}
490\section{FreeBSD Bare Metal Recovery}
491\index[general]{Recovery!FreeBSD Bare Metal}
492\index[general]{Rescue!FreeBSD Bare Metal}
493\index[general]{FreeBSD Bare Metal Recovery}
494
495The same basic techniques described above also apply to FreeBSD. Although we
496don't yet have a fully automated procedure, Alex Torres Molina has provided us
497with the following instructions with a few additions from Jesse Guardiani and
498Dan Langille:
499
500\begin{enumerate}
501\item Boot with the FreeBSD installation disk
502\item Go to Custom, Partition and create your slices and go to Label and
503   create the partitions that you want. Apply changes.
504\item Go to Fixit to start an emergency console.
505\item Create devs ad0 .. .. if they don't exist under /mnt2/dev (in my  situation)
506   with MAKEDEV. The device or devices you  create depend on what hard drives you
507   have. ad0 is your  first ATA drive. da0 would by your first SCSI drive.  Under
508OS version 5 and greater, your device files are  most likely automatically
509created for you.
510\item mkdir /mnt/disk
511   this is the root of the new disk
512\item mount /mnt2/dev/ad0s1a /mnt/disk
513   mount /mnt2/dev/ad0s1c /mnt/disk/var
514   mount /mnt2/dev/ad0s1d /mnt/disk/usr
515.....
516The same hard drive issues as above apply here too.  Note, under OS version 5
517or higher, your disk devices may  be in /dev not /mnt2/dev.
518\item Network configuration (ifconfig xl0 ip/mask + route add default
519   ip-gateway)
520\item mkdir /mnt/disk/tmp
521\item cd /mnt/disk/tmp
522\item Copy bacula-fd and bacula-fd.conf to this path
523\item If you need to, use sftp to copy files, after which you must do this:
524   ln -s /mnt2/usr/bin /usr/bin
525\item chmod u+x bacula-fd
526\item Modify bacula-fd.conf to fit this machine
527\item Copy /bin/sh to /mnt/disk, necessary for chroot
528\item Don't forget to put your bacula-dir's IP address and domain  name in
529   /mnt/disk/etc/hosts if it's not on a public net.  Otherwise the FD on the
530   machine you are restoring to  won't be able to contact the SD and DIR on the
531remote machine.
532\item mkdir -p /mnt/disk/var/db/bacula
533\item chroot /mnt/disk /tmp/bacula-fd -c /tmp/bacula-fd.conf
534   to start bacula-fd
535\item Now you can go to bacula-dir and restore the job with the entire
536   contents of the broken server.
537\item You must create /proc
538\end{enumerate}
539
540\label{solaris}
541\section{Solaris Bare Metal Recovery}
542\index[general]{Solaris Bare Metal Recovery}
543\index[general]{Recovery!Solaris Bare Metal}
544
545The same basic techniques described above apply to Solaris:
546
547\begin{itemize}
548\item the same restrictions as those given for Linux apply
549\item you will need to create a Rescue disk
550   \end{itemize}
551
552However, during the recovery phase, the boot and disk preparation procedures
553are different:
554
555\begin{itemize}
556\item there is no need to create an emergency boot disk  since it is an
557   integrated part of the Solaris boot.
558\item you must partition and format your hard disk by hand  following manual
559   procedures as described in W. Curtis Preston's  book "Unix Backup \&
560   Recovery"
561\end{itemize}
562
563Once the disk is partitioned, formatted and mounted, you can continue with
564bringing up the network and reloading Bacula.
565
566\section{Preparing Solaris Before a Disaster}
567\index[general]{Preparing Solaris Before a Disaster}
568\index[general]{Disaster!Preparing Solaris Before a}
569
570As mentioned above, before a disaster strikes, you should prepare the
571information needed in the case of problems. To do so, in the {\bf
572rescue/solaris} subdirectory enter:
573
574\footnotesize
575\begin{verbatim}
576su
577./getdiskinfo
578./make_rescue_disk
579\end{verbatim}
580\normalsize
581
582The {\bf getdiskinfo} script will, as in the case of Linux described above,
583create a subdirectory {\bf diskinfo} containing the output from several system
584utilities. In addition, it will contain the output from the {\bf SysAudit}
585program as described in Curtis Preston's book. This file {\bf
586diskinfo/sysaudit.bsi} will contain the disk partitioning information that
587will allow you to manually follow the procedures in the "Unix Backup \&
588Recovery" book to repartition and format your hard disk. In addition, the
589{\bf getdiskinfo} script will create a {\bf start\_network} script.
590
591Once you have your disks repartitioned and formatted, do the following:
592
593\begin{itemize}
594\item Start Your Network with the {\bf start\_network} script
595\item Restore the Bacula File daemon as documented above
596\item Perform a Bacula restore of all your files using the same  commands as
597   described above for Linux
598\item Re-install your boot loader using the instructions outlined  in the
599   "Unix Backup \& Recovery" book  using installboot
600\end{itemize}
601
602\label{genbugs}
603
604\section{Bugs and Other Considerations}
605\index[general]{Considerations!Bugs and Other}
606\index[general]{Bugs and Other Considerations}
607
608\paragraph*{Directory Modification and Access Times are Modified on pre-1.30
609Baculas :}
610
611When a pre-1.30 version of Bacula restores a directory, it first must create
612the directory, then it populates the directory with its files and
613subdirectories. The act of creating the files and subdirectories updates both
614the modification and access times associated with the directory itself. As a
615consequence, all modification and access times of all directories will be
616updated to the time of the restore.
617
618This has been corrected in Bacula version 1.30 and later. The directory
619modification and access times are reset to the value saved in the backup after
620all the files and subdirectories have been restored. This has been tested and
621verified on normal restore operations, but not verified during a bare metal
622recovery.
623
624\paragraph*{Strange Bootstrap Files:}
625
626If any of you look closely at the bootstrap file that is produced and used for
627the restore (I sure do), you will probably notice that the FileIndex item does
628not include all the files saved to the tape. This is because in some instances
629there are duplicates (especially in the case of an Incremental save), and in
630such circumstances, {\bf Bacula} restores only the last of multiple copies of
631a file or directory.
632
633\label{Win3233}
634\section{Disaster Recovery of Win32 Systems}
635\index[general]{Systems!Disaster Recovery of Win32}
636\index[general]{Disaster Recovery of Win32 Systems}
637
638Due to open system files, and registry problems, Bacula cannot save and
639restore a complete Win2K/XP/NT environment.
640
641A suggestion by Damian Coutts using Microsoft's NTBackup utility in
642conjunction with Bacula should permit a Full bare metal restore of Win2K/XP
643(and possibly NT systems). His suggestion is to do an NTBackup of the critical
644system state prior to running a Bacula backup with the following command:
645
646\footnotesize
647\begin{verbatim}
648ntbackup backup systemstate /F c:\systemstate.bkf
649\end{verbatim}
650\normalsize
651
652The {\bf backup} is the command, the {\bf systemstate} says to backup only the
653system state and not all the user files, and the {\bf /F
654c:\textbackslash{}systemstate.bkf} specifies where to write the state file.
655this file must then be saved and restored by Bacula. This command
656can be put in a Client Run Before Job directive so that it is automatically
657run during each backup, and thus saved to a Bacula Volume.
658
659To restore the system state, you first reload a base operating system, then
660you would use Bacula to restore all the users files and to recover the {\bf
661c:\textbackslash{}systemstate.bkf} file, and finally, run {\bf NTBackup} and
662{\bf catalogue} the system statefile, and then select it for restore. The
663documentation says you can't run a command line restore of the systemstate.
664
665This procedure has been confirmed to work by Ludovic Strappazon -- many
666thanks!
667
668A new tool is provided in the form of a bacula plugin for the BartPE rescue
669CD. BartPE is a self-contained WindowsXP boot CD which you can make using the
670PeBuilder tools available at
671\elink{http://www.nu2.nu/pebuilder/}{http://www.nu2.nu/pebuilder/} and a valid
672Windows XP SP1 CDROM. The plugin is provided as a zip archive. Unzip the file
673and copy the bacula directory into the plugin directory of your BartPE
674installation. Edit the configuration files to suit your installation and build
675your CD according to the instructions at Bart's site. This will permit you to
676boot from the cd, configure and start networking, start the bacula file client
677and access your director with the console program. The programs menu on the
678booted CD contains entries to install the file client service, start the file
679client service, and start the WX-Console. You can also open a command line
680window and CD Programs\textbackslash{}Bacula and run the command line console
681bconsole.
682
683\section{Ownership and Permissions on Win32 Systems}
684\index[general]{Systems!Resetting Directory and File Ownership and Permissions
685on Win32}
686\index[general]{Resetting Directory and File Ownership and Permissions on
687Win32 Systems}
688% TODO: should this be in the win32 chapter?
689
690Bacula versions after 1.31 should properly restore ownership and permissions
691on all WinNT/XP/2K systems. If you do experience problems, generally in
692restores to alternate directories because higher level directories were not
693backed up by Bacula, you can correct any problems with the {\bf SetACL}
694available under the GPL license at:
695\elink{http://sourceforge.net/projects/setacl/}{http://sourceforge.net/project%
696s/setacl/}.
697
698\section{Alternate Disaster Recovery Suggestion for Win32 Systems}
699\index[general]{Systems!Alternate Disaster Recovery Suggestion for Win32}
700\index[general]{Alternate Disaster Recovery Suggestion for Win32 Systems}
701% TODO: should this be in the win32 chapter??
702
703Ludovic Strappazon has suggested an interesting way to backup and restore
704complete Win32 partitions. Simply boot your Win32 system with a Linux Rescue
705disk as described above for Linux, install a statically linked Bacula, and
706backup any of the raw partitions you want. Then to restore the system, you
707simply restore the raw partition or partitions. Here is the email that Ludovic
708recently sent on that subject:
709
710\footnotesize
711\begin{verbatim}
712I've just finished testing my brand new cd LFS/Bacula
713with a raw Bacula backup and restore of my portable.
714I can't resist sending you the results: look at the rates !!!
715hunt-dir: Start Backup JobId 100, Job=HuntBackup.2003-04-17_12.58.26
716hunt-dir: Bacula 1.30 (14Apr03): 17-Apr-2003 13:14
717JobId:                  100
718Job:                    HuntBackup.2003-04-17_12.58.26
719FileSet:                RawPartition
720Backup Level:           Full
721Client:                 sauvegarde-fd
722Start time:             17-Apr-2003 12:58
723End time:               17-Apr-2003 13:14
724Files Written:          1
725Bytes Written:          10,058,586,272
726Rate:                   10734.9 KB/s
727Software Compression:   None
728Volume names(s):        000103
729Volume Session Id:      2
730Volume Session Time:    1050576790
731Last Volume Bytes:      10,080,883,520
732FD termination status:  OK
733SD termination status:  OK
734Termination:            Backup OK
735hunt-dir: Begin pruning Jobs.
736hunt-dir: No Jobs found to prune.
737hunt-dir: Begin pruning Files.
738hunt-dir: No Files found to prune.
739hunt-dir: End auto prune.
740hunt-dir: Start Restore Job RestoreFilesHunt.2003-04-17_13.21.44
741hunt-sd: Forward spacing to file 1.
742hunt-dir: Bacula 1.30 (14Apr03): 17-Apr-2003 13:54
743JobId:                  101
744Job:                    RestoreFilesHunt.2003-04-17_13.21.44
745Client:                 sauvegarde-fd
746Start time:             17-Apr-2003 13:21
747End time:               17-Apr-2003 13:54
748Files Restored:         1
749Bytes Restored:         10,056,130,560
750Rate:                   5073.7 KB/s
751FD termination status:  OK
752Termination:            Restore OK
753hunt-dir: Begin pruning Jobs.
754hunt-dir: No Jobs found to prune.
755hunt-dir: Begin pruning Files.
756hunt-dir: No Files found to prune.
757hunt-dir: End auto prune.
758\end{verbatim}
759\normalsize
760
761\label{running}
762
763\section{Restoring to a Running System}
764\index[general]{System!Restoring to a Running}
765\index[general]{Restoring to a Running System}
766
767If for some reason you want to do a Full restore to a system that has a
768working kernel (not recommended), you will need to take care not to
769overwrite the following files:
770
771\footnotesize
772\begin{verbatim}
773/etc/grub.conf
774/etc/X11/Conf
775/etc/fstab
776/etc/mtab
777/lib/modules
778/usr/modules
779/usr/X11R6
780/etc/modules.conf
781\end{verbatim}
782\normalsize
783
784\label{Resources}
785
786\section{Additional Resources}
787\index[general]{Additional Resources}
788\index[general]{Resources!Additional}
789
790Many thanks to Charles Curley who wrote
791\elink{Linux Complete Backup and Recovery HOWTO}
792{http://www.tldp.org/HOWTO/Linux-Complete-Backup-and-Recovery-HOWTO/index.html%
793} for the
794\elink{The Linux Documentation Project}{http://www.tldp.org/}. This is an
795excellent document on how to do Bare Metal Recovery on Linux systems, and it
796was this document that made me realize that Bacula could do the same thing.
797
798You can find quite a few additional resources, both commercial and free at
799\elink{Storage Mountain}{http://www.backupcentral.com}, formerly known as
800Backup Central.
801
802And finally, the O'Reilly book, "Unix Backup \& Recovery" by W. Curtis
803Preston covers virtually every backup and recovery topic including bare metal
804recovery for a large range of Unix systems.
805