Blame

19a3e4 Dave LeBlanc 2026-12-01 17:34:54
initial document on Tue Dec 1 17:34:22 2026
1
# Disaster Recovery
20b04a Dave LeBlanc 2026-12-01 23:39:18
Disaster Recovery updated on Tue Dec 1 23:39:06 2026
2
This, and subseqent documents, will attempt to avoid being procedural, as technical details can and will change, but will attempt to be conceptual with general details.
3
Scope we will cover includes:
4
- Data backup/restore
5
- Security monitoring/access
6
- Power outages
7
8
## Data Backup/Restore
9
In CMS, the restoration goal is a Restoration Data Point (RDP) of 1 month, meaning that as a goal data should be restored to no more than one month before the disaster.
10
Archives are not kept for data, because they present an ongoing cost for media maintenance. Devices must be kept that read the media, or media needs to be transcribed to new media, eg. CD backups need CD readers → DVD backups need DVD readers, etc.
11
12
It became prohibitively costly to maintain a tape library for the few terabytes of data that needed to be backed up.
13
Tangentially, we discontinued subscription for the backup software involved in running a tape library for backup.
14
15
As a result, the entire backup/restore operation is cost free, minus the ongoing cost of physical tapes.
16
Currently, there is zero off-site backup. All physical media is stored on-site, either in the same room as the device(s) or in an adjacent room.
17
18
### Devices to Backup/Restore
19
The philosophy has always been to store important data centrally, and then backup the data from the central location.
20
*This is the opposite of a distributed system where data is kept on computation nodes, and then backed up individually, which complicates restoral and data disposition.*
21
The file server (*filer*) in this case is the central data location in which all important data is held.
22
Fortunately, it is a NetApp device, which means it can handle [NDMP](https://www.snia.org/ndmp), a network-based data backup protocol that defines basically 3 components in any backup system:
23
- Data interface
24
- Tape/SCSI interface
25
- File history/logging interface
26
27
In this way, backup devices can be physically and geographically separate from the backup software and/or the data device to be backed up.
28
```mermaid
29
---
30
title: NDMP concept
31
---
32
flowchart LR
33
subgraph BH[Backup Host]
34
BS[[Backup Software]]
35
Cache[(Database)]
36
end
37
subgraph NA[File Server]
38
FS@{ shape: lin-cyl, label: "Disk storage" }
39
end
40
subgraph S[Storage Device]
41
Tape@{ shape: flag, label: "Tape Device/Library" }
42
end
43
BS <-.-> FS
44
BS <-- tape control --> Tape
45
FS == file backup ==> Tape
46
Tape -. index of files .-> Cache
47
style BH fill:#333
48
```
49
Historically, as with the tape library and commercial software, the tape library was attached to the file server.
50
The advantage of this was the data did not have far to travel and was much faster to write via local SCSI rather than Cat-6 network.
51
```mermaid
52
---
53
title: Historical Config with Tape Lib
54
---
55
flowchart LR
56
subgraph BH[Backup Host]
57
BS[[Backup Software]]
58
Cache[(Database)]
59
end
60
subgraph NA[File Server]
61
FS@{ shape: lin-cyl, label: "Disk storage" }
62
Tape@{ shape: flag, label: "Tape Library/Robot" }
63
end
64
BS <-.-> FS
65
BS <-- robot control --> Tape
66
FS == file backup ==> Tape
67
Tape -. index of files .-> Cache
68
style NA fill:#000,stroke:#145ed5
69
style BH fill:#111,stroke:#2dccc7
70
```
71
#### Current Configuration
72
**Current Operation** with the Tape Device on the Backup Host:
73
```mermaid
74
---
75
title: Current Config
76
---
77
flowchart LR
78
subgraph BH[Backup Host]
79
BS[[Backup Software]]
80
Cache[(Database)]
81
Tape@{ shape: flag, label: "Tape Device" }
82
end
83
subgraph NA[File Server]
84
FS@{ shape: lin-cyl, label: "Disk storage" }
85
end
86
BS <-.-> FS
87
BS <-- tape control --> Tape
88
FS == file backup over network ==> Tape
89
FS -. index of files .-> Cache
90
style NA fill:#000,stroke:#145ed5
91
style BH fill:#111,stroke:#2dccc7
92
```
93
The disadvantage here is the data to be backed up must travel over the network, to the Backup Host where the tape drive is attached.
94
This takes considerably longer, as network transfer speeds are much slower than SCSI.
95
However, there still remains the advantage of not needing to mount data for backup, which presents permissions and ownership complexity in the metadata. Instead of something like backing up over NFS, the data is directly streamed through the backup host to the tape device.
96
97
For this, the software [BareOS](https://www.bareos.com/learn/documentation/) is installed and configured, which we will detail the configuration below.
98
Detailed documentation regarding the software itself can be viewed via the link above.
99
100
##### Software Configuration
101
BareOS is divided into 3 constiuent parts/daemons: File Daemon (`bareos-fd`), Storage Daemon (`bareos-sd`), Director Daemon (`bareos-dir`).
102
103
The *File Daemon* runs on each client to be backed up and listens for the Director's call and sends them the data for backup. It is also responsible for the filesystem component of any restore operation.
104
The *Storage Daemon* handles any actions regarding storing the backed up files, including their disposition and indexing, as well as the destination of backed up data. There can be one or more Storage Daemons, each with their own physical devices/locations (such as tape drives, external drives, etc).
105
The *Director Daemon* orchestrates the interaction between the File and Storage daemons, and schedules backups to be performed, as well as the meta-information of all systems/data that has been backed up.
106
107
Configuration for all these is located in `/etc/bareos`, and their sub-directories, `bareos-fd.d`, `bareos-sd.d`, and `bareos-dir.d`, respectively.
108
For BareOS to work in the current configuation (above) with NDMP, we must first declare NDMP devices, because BareOS natively assumes all data to be backed up is available to the *File Daemon* locally installed, but we can't install software onto a NetApp Filer.
109
Therefore, we create NDMP Tape drives, which are exposed within the NDMP framework, and correspond to the physical tape devices for BareOS to access.
110
111
First, BareOS needs to know about the actual tape devices, so in `/etc/bareos-sd.d/device/TapeStorage.conf`:
112
```
113
Device {
114
Name = TapeStorage0
115
Device Type = Tape
116
Media Type = Tape
117
Archive Device = /dev/nst0
118
DriveIndex = 0
119
Label Media = no; # lets Bareos label unlabeled media
120
Random Access = no;
121
AutomaticMount = yes; # when device opened, read it
122
Autochanger = no; # there is no robot
123
RemovableMedia = yes;
124
AlwaysOpen = yes;
125
Description = "Tape device. A connecting Director must have the same Name and MediaType."
126
MaximumFileSize = 20GB # default: 1000000000 (1GB)
127
}
128
129
Device {
130
Name = TapeStorage1
131
Device Type = Tape
132
Media Type = Tape
133
Archive Device = /dev/nst1
134
DriveIndex = 1
135
Label Media = no; # lets Bareos label unlabeled media
136
Random Access = no;
137
AutomaticMount = yes; # when device opened, read it
138
Autochanger = no; # there is no robot
139
RemovableMedia = yes;
140
AlwaysOpen = yes;
141
Description = "Tape device. A connecting Director must have the same Name and MediaType."
142
MaximumFileSize = 20GB # default: 1000000000 (1GB)
143
}
144
```
145
We'll use 2 tape drives so that we don't need to change tapes constantly between **full** backups and **incremental** backups.
146
One drive will be used for **full** and the other for **incremental**;
147
`/dev/nst0` for **Level 0** backups
148
`/dev/nst1` for **Level 1** backups
149
These device names correspond to the Linux devices natively.
150
151
With BareOS now aware of the two tape devices, we'll enable NDMP within BareOS, setting `/etc/bareos-sd.d/storage/bareos-sd.conf` with:
152
```
153
Storage {
154
Name = bareos-sd
155
156
# remove comment from "Plugin Directory" to load plugins from specified directory.
157
# if "Plugin Names" is defined, only the specified plugins will be loaded,
158
# otherwise all storage plugins (*-sd.so) from the "Plugin Directory".
159
#
160
# Plugin Directory = "/usr/lib/bareos/plugins"
161
# Plugin Names = ""
162
NDMP Enable = yes
163
}
164
# This resource gives the DMA in the Director access to the Bareos SD via
165
# the NDMP protocol.
166
# This option is used via the NDMP protocol to open the right TAPE AGENT
167
# connection to your Bareos SD via the NDMP protocol.
168
# The initialization of the SD is done via the native protocol and is
169
# handled via the PairedStorage keyword.
170
Ndmp {
171
Name = BARE-ndmp-tape
172
Username = ndmpadmin
173
Password = "<password>"
174
AuthType = Clear
175
}
176
```
177
In the file `/etc/bareos-dir.d/storage/Tape0.conf`:
178
```
179
# Tape0 for all FULL backup
180
Storage {
181
Name = Tape0
182
Address = bare # N.B. Use a fully qualified name here (do not use "localhost" here).
183
Password = "<bare-dir-password>"
184
Device = TapeStorage0
185
Media Type = Tape
186
Maximum Concurrent Jobs = 10
187
}
188
# The above Storage entry should match SD->Director->bareos-dir.conf
189
190
# Same storage daemon but via NDMP protocol.
191
# We link via the PairedStorage config option the Bareos SD
192
# instance definition to a NDMP TAPE AGENT.
193
Storage {
194
Name = NDMPTape0
195
Address = bare.cms.caltech.edu
196
Port = 10000
197
Protocol = NDMPv4
198
Auth Type = Clear
199
Username = ndmpadmin
200
Password = "<password>"
201
Device = TapeStorage0
202
Media Type = Tape
203
PairedStorage = Tape0
204
}
205
```
206
> [!Note]
207
> The `ndmpadmin` password in `/etc/bareos-sd.d/storage/bareos-sd.conf` must match the `ndmpadmin` password in `/etc/bareos-dir.d/storage/Tape0.conf`.
208
> Also, the "bare-dir-password" above must match the password in `/etc/bareos/bareos-sd.d/director/bareos-dir.conf`, such that it appears as:
209
> ```
210
> Director {
211
> Name = bareos-dir
212
> Password = "bare-dir-password"
213
> Description = "Director, who is permitted to contact this storage daemon."
214
> }
215
> ```
216
217
Of course, since we have **2 tape drives**, we need two NDMP tapes; `NDMPTape0` and `NDMPTape1`, so there needs to also be a `/etc/bareos-dir.d/storage/Tape1.conf` file with similar settings for `TapeStorage1`.
218
Conceptually, we'll have:
219
```mermaid
220
---
221
config:
222
htmlLabels: false
223
markdownAutoWrap: false
224
---
225
flowchart LR
226
ND0[NDMPTape0] e0@--> T0[TapeStorage0] e1@--> d0["`*/dev/nst0*`"]
227
e0@{ animate: true }
228
e1@{ animate: true }
229
ND1[NDMPTape1] e2@--> T1[TapeStorage1] e3@--> d1["`*/dev/nst1*`"]
230
e2@{ animate: true }
231
e3@{ animate: true }
232
```
233
Consequentially, any action involving either `NDMPTape[0|1]` or `TapeStorage[0|1]` automatically translates to `/dev/nst[0|1]` on the local system.
234
235
###### *Scheduling and Volumes*
236
Because the current configuration involves backing up over the network, its best to break up the datasets by volume on the file server, lest anything go wrong during the backup, the entire operation needs to reset from the beginning.
237
With smaller datasets; i.e. by filesystem volume, if anything goes wrong during the backup, the operation resets only for that volume.
238
239
In `/etc/bareos/bareos-dir.d/fileset`, there are a set of files declaring each volume on the file server to backup similar to `Filer_ams.conf`:
240
```
241
Fileset {
242
Name = "FILER_NDMPbu_ams"
243
Include {
244
Options {
245
Compression = GZIP
246
#If we have NDMP options, set them here via
247
#meta = "TYPE=DUMP"
248
#meta = "HIST=F"
249
meta = "BUTYPE=DUMP"
250
}
251
File = /nfs_svm0/ams
252
}
253
}
254
```
255
`FILER_NDMPbu_ams` is the name given to distinguish a backup set in BareOS that corresponds to the filesystem `/nfs_svm0/ams` on the file server.
256
(`nfs_svm0`) is the name local to the NetApp Filer for the SVM where all the data lives. See [Filer Operation](/Sysadmin/Filer).
257
There are currently 17 volumes on the Filer, so there should be 17 config files similar to `Filer_ams.conf`, albeit specific to the volume.
258
These files correspond to **job** declarations in `/etc/bareos/bareos-dir.d/job/FILER-bu-<volume>.conf`:
259
```
260
Job {
261
Name = "FILER-backup-ams"
262
Type = Backup
263
JobDefs = "FilerJob"
264
Client = "FILER-NDMP"
265
FileSet = "FILER_NDMPbu_ams"
266
Schedule = "WeeklyCycle"
267
}
268
```
269
Take note of `FileSet` -- they must match.
270
A new attribute is present: `Client = "FILER-NDMP"`.
271
This corresponds to the *client* declared in `/etc/bareos/bareos-dir.d/client/bareos-fd.conf`:
272
```
273
Client {
274
Name = bareos-fd
275
Description = "Client resource of the Director itself."
276
Address = localhost
277
Password = "<bare-dir-password>" # password for FileDaemon
278
}
279
280
Client {
281
Name = FILER-NDMP
282
Address = "131.215.140.151"
283
Port = 10000
284
Protocol = NDMPv4
285
Auth Type = MD5
286
Username = "ndmpuser"
287
Password = "<password>"
288
}
289
```
290
Here `ndmpuser` has a different password from previously mentioned, as its created on the NetApp as a user specifically for NDMP backup.
291
We also specificy how we will be connecting to the `FILER-NDMP` client, and of course this corresponds to each **job** declared above.
292
Only one thing left to tie it all together: **Job Definitions**
293
In `/etc/bareos/bareos-dir.d/jobdefs/FilerJob.conf`:
294
```
295
JobDefs {
296
Name = "FilerJob"
297
Type = Backup
298
Level = Differential
299
Client = "FILER-NDMP"
300
Schedule = "WeeklyCycle"
301
Storage = NDMPTape1
302
Backup Format = dump
303
Messages = Standard
304
Pool = Differential
305
Priority = 10
306
Protocol = NDMP_BAREOS
307
Write Bootstrap = "/var/lib/bareos/%c.bsr"
308
Full Backup Pool = Full # write Full Backups into "Full" Pool
309
Differential Backup Pool = Differential # write Diff Backups into "Differential" Pool
310
}
311
```
312
This defines a *default* job which will use all the particulars related to the **client** for the given backup job.
313
How to know which backup job? The *schedule*, of course!
314
In `/etc/bareos/bareos-dir.d/schedule/WeeklyCycle.conf`:
315
```
316
Schedule {
317
Name = "WeeklyCycle"
318
Run = Level=Full Pool=Full Storage=NDMPTape0 1st fri at 21:00
319
Run = Level=Differential Pool=Differential Storage=NDMPTape1 2nd-5th fri at 21:00
320
}
321
```
322
***Every week*** the software will run.
323
On the *first Friday* of every month, at *9pm*, a full (Level 0) will be done.
324
On every *other Friday* of every month, at *9pm*, a differential (Level 1) will be done.
325
326
> [!Note]
327
> Differential is different from Incremental, at least in the scheme of BareOS.
328
> **Full**, of course is Level 0 -- backup everything.
329
> **Differential** is Level 1 -- backup everything changed since Level 0.
330
> **Incremental** is Level 1 -- backup everything changed since Level 0 or since last Level 1.
331
> Each new Incremental becomes a new Level (Level 1 &rarr; Level 2 &rarr; Level 3, etc.) up to Level 8.
332
333
The trick here is "since last Level X".
334
In BareOS NDMP, and the NetApp, communication does not always happen to note the date/time of the Level 1 being done.
335
We can only be certain the date/time of Level 0 for each volume, as the NetApp does absolutely mark the date/time for this.
336
As a workaround, we back up **Differential** mainly, because that is based on the last **Level 0**.
337
The result is that, on average, each **Differential** backup will be larger each week until the next month's Level 0 full backup, which resets all the previous Differential backups.
338
339
The other file, `/etc/bareos/bareos-dir.d/schedule/WeeklyCycleAfterBackup.conf` is a placeholder to backup the BareOS Catalog:
340
```
341
Schedule {
342
Name = "WeeklyCycleAfterBackup"
343
Description = "This schedule does the catalog. It starts after the WeeklyCycle."
344
Run = Full fri at 21:10
345
}
346
```
347
which will update its database of files backed up, after each backup has been completed.
348
349
##### Restoring
350
The most important part of this entire system: Restoring the data.
351
352
Since we use NDMP with BareOS, for performance reasons it is recommended to use `bconsole` rather than the web-ui.
353
For information about `bconsole` restore, see [BareOS Restore Command](https://docs.bareos.org/TasksAndConcepts/TheRestoreCommand.html).
354
`bconsole` is quite helpful when performing operations as it has an extensive help system built-in.
355
Of course, to access `bconsole`, you need to be logged into the backup host.
356
357
When using `bconsole`, take note of the above references to **jobs**, **client** name, and **storage devices** (like NDMPTape0), etc.