Debian Codegraph @

manuals/en/main/rescue.tex

raw
1 \chapter{Disaster Recovery Using \bacula{}}
2 \label{blb:RescueChapter}
3 \index[general]{Disaster Recovery Using \bacula{}}
4 \index[general]{\bacula{}!Disaster Recovery Using}
5 \index[general]{Recovery!Disaster Recovery}
6 \index[general]{Rescue!Disaster Recovery}
7
8 \section{General}
9 \index[general]{General}
10
11 When disaster strikes, you must have a plan, and you must have prepared in
12 advance otherwise the work of recovering your system and your files will be
13 considerably greater. For example, if you have not previously saved the
14 partitioning information for your hard disk, how can you properly rebuild
15 it if the disk must be replaced?
16 Unfortunately, many of the steps one must take before and immediately after
17 a disaster are very operating system dependent.
18
19 \smallskip
20 \bacula{} Systems provides special Linux\acs{BMR} and Win\acs{BMR}packages that
21 largely automate and simplify recovery even with a very large
22 number of machines. The documentation and details of these products
23 are contained in separate white papers. If you need them,
24 please ask your \bacula{} Systems sales representative.
25
26 \smallskip
27 Below are a few additional points that may or may not help.
28
29
30 \label{blb:considerations1}
31 \section{Important Considerations}
32 \index[general]{Important Considerations}
33 \index[general]{Considerations!Important}
34
35 Here are a few important considerations concerning disaster recovery that
36 you should take into account before a disaster strikes.
37
38 \begin{bitemize}
39 \item If the building which houses your computers burns down or is otherwise
40 destroyed, do you have off-site backup data?
41 \item Disaster recovery is much easier if you have several machines. If you
42 have a single machine, how will you handle unforeseen events if your only
43 machine is down?
44 \item Do you want to protect your whole system and use \bacula{} to recover
45 everything? or do you want to try to restore your system from the original
46 installation disks and apply any other updates and only restore user files?
47 \end{bitemize}
48
49
50 \label{blb:FreeBSD1}
51 \section{FreeBSD Bare Metal Recovery}
52 \index[general]{Recovery!FreeBSD Bare Metal}
53 \index[general]{Rescue!FreeBSD Bare Metal}
54 \index[general]{FreeBSD Bare Metal Recovery}
55
56 The same basic techniques described above also apply to FreeBSD. Although we
57 don't yet have a fully automated procedure, Alex Torres Molina has provided us
58 with the following instructions with a few additions from Jesse Guardiani and
59 Dan Langille:
60
61 \begin{benumerate}
62 \item Boot with the FreeBSD installation disk
63 \item Go to Custom, Partition and create your slices and go to Label and
64 create the partitions that you want. Apply changes.
65 \item Go to Fixit to start an emergency console.
66 \item Create devs \bfilename{ad0} .. .. if they don't exist under \bdirectoryname{/mnt2/dev} (in my situation)
67 with \btool{MAKEDEV}. The device or devices you create depend on what hard drives you
68 have. \bfilename{ad0} is your first ATA drive. \bfilename{da0} would by your first\acs{SCSI} drive. Under
69 \acs{OS} version 5 and greater, your device files are most likely automatically
70 created for you.
71 \item \begin{bVerbatim}
72 mkdir /mnt/disk
73 \end{bVerbatim}
74
75 this is the root of the new disk
76 \item \begin{bVerbatim}
77 mount /mnt2/dev/ad0s1a /mnt/disk
78 mount /mnt2/dev/ad0s1c /mnt/disk/var
79 mount /mnt2/dev/ad0s1d /mnt/disk/usr
80 .....
81 \end{bVerbatim}
82 The same hard drive issues as above apply here too. Note, under \acs{OS} version 5
83 or higher, your disk devices may be in \bdirectoryname{/dev} not \bdirectoryname{/mnt2/dev}.
84 \item Network configuration
85 \begin{bVerbatim}
86 ifconfig xl0 ip/mask + route add default ip-gateway
87 \end{bVerbatim}
88 \item \begin{bVerbatim}
89 mkdir /mnt/disk/tmp
90 \end{bVerbatim}
91 \item \begin{bVerbatim}
92 cd /mnt/disk/tmp
93 \end{bVerbatim}
94 \item Copy \bfilename{bacula-fd} and \bfilename{bacula-fd.conf} to this path
95 \item If you need to, use \btool{sftp} to copy files, after which you must do this:
96 \begin{bVerbatim}
97 ln -s /mnt2/usr/bin /usr/bin
98 \end{bVerbatim}
99 \item \begin{bVerbatim}
100 chmod u+x bacula-fd
101 \end{bVerbatim}
102 \item Modify \bfilename{bacula-fd.conf} to fit this machine
103 \item Copy \bfilename{/bin/sh} to \bfilename{/mnt/disk}, necessary for \btool{chroot}
104 \item Don't forget to put your bacula-dir's \acs{IP} address and domain name in
105 \bfilename{/mnt/disk/etc/hosts} if it's not on a public net. Otherwise the \acs{FD} on the
106 machine you are restoring to won't be able to contact the \acs{SD} and DIR on the
107 remote machine.
108 \item \begin{bVerbatim}
109 mkdir -p /mnt/disk/var/db/bacula
110 \end{bVerbatim}
111 \item \begin{bVerbatim}
112 chroot /mnt/disk /tmp/bacula-fd -c /tmp/bacula-fd.conf
113 \end{bVerbatim}
114 to start bacula-fd
115 \item Now you can go to bacula-dir and restore the job with the entire
116 contents of the broken server.
117 \item You must create \bdirectoryname{/proc}
118 \end{benumerate}
119
120 \label{blb:solaris}
121 \section{Solaris Bare Metal Recovery}
122 \index[general]{Solaris Bare Metal Recovery}
123 \index[general]{Recovery!Solaris Bare Metal}
124
125 The same basic techniques described above apply to Solaris:
126
127 \begin{bitemize}
128 \item the same restrictions as those given for Linux apply
129 \item you will need to create a Rescue disk
130 \end{bitemize}
131
132 However, during the recovery phase, the boot and disk preparation procedures
133 are different:
134
135 \begin{bitemize}
136 \item there is no need to create an emergency boot disk since it is an
137 integrated part of the Solaris boot.
138 \item you must partition and format your hard disk by hand following manual
139 procedures as described in W. Curtis Preston's book ``Unix Backup \&
140 Recovery''
141 \end{bitemize}
142
143 Once the disk is partitioned, formatted and mounted, you can continue with
144 bringing up the network and reloading \bacula{}.
145
146 \section{Preparing Solaris Before a Disaster}
147 \index[general]{Preparing Solaris Before a Disaster}
148 \index[general]{Disaster!Preparing Solaris Before a}
149
150 As mentioned above, before a disaster strikes, you should prepare the
151 information needed in the case of problems. To do so, in the \textbf{\bdirectoryname{rescue/solaris}} subdirectory enter:
152
153 \begin{bVerbatim}
154 su
155 ./getdiskinfo
156 ./make_rescue_disk
157 \end{bVerbatim}
158
159 The \btool{getdiskinfo} script will, as in the case of Linux described above,
160 create a subdirectory \textbf{\bdirectoryname{diskinfo}} containing the output from several system
161 utilities. In addition, it will contain the output from the \btool{SysAudit}
162 program as described in Curtis Preston's book. This file \bfilename{diskinfo/sysaudit.bsi}
163 will contain the disk partitioning information that
164 will allow you to manually follow the procedures in the ``Unix Backup \& Recovery''
165 book to repartition and format your hard disk. In addition, the
166 \btool{getdiskinfo} script will create a \btool{start\_network} script.
167
168 Once you have your disks repartitioned and formatted, do the following:
169
170 \begin{bitemize}
171 \item Start Your Network with the \btool{start\_network} script
172 \item Restore the \bacula{} File daemon as documented above
173 \item Perform a \bacula{} restore of all your files using the same commands as
174 described above for Linux
175 \item Re-install your boot loader using the instructions outlined in the
176 ``Unix Backup \& Recovery'' book using installboot
177 \end{bitemize}
178