]> git.proxmox.com Git - proxmox-backup.git/blame - docs/tape-backup.rst
tape: changer transfer - make name parameter optional
[proxmox-backup.git] / docs / tape-backup.rst
CommitLineData
5f79dc28
DM
1Tape Backup
2===========
3
4Our tape backup solution provides a easy way to store datastore
54d96866 5contents to a tape. This increases data safety because you get:
5f79dc28
DM
6
7- an additional copy of the data
8- to a different media type (tape)
9- to an additional location (you can move tape offsite)
10
54d96866
DM
11Statistics show that 95% of all restore jobs restores the last
12backup. Restore requests further declines the older the data gets.
13Considering that, tape backup may also help to reduce disk usage,
14because you can safely remove data from disk once archived on tape.
15This is especially true if you need to keep data for several years.
16
17Tape backups do not provide random access to the stored data. Instead,
18you need to restore the data to disk before you can access it
19again. Also, if you store your tapes offsite (using some kind of tape
20vaulting service), you need to bring them onsite before you can do any
21restore. So please consider that restores from tapes can take much
22longer than restores from disk.
5f79dc28
DM
23
24
25Tape Technology Primer
26----------------------
27
28.. _Linear Tape Open: https://en.wikipedia.org/wiki/Linear_Tape-Open
29
30As of 2021, the only broadly available tape technology standard is
31`Linear Tape Open`_, and different vendors offers LTO Ultrium tape
54d96866
DM
32drives, autoloaders and LTO tape cartridges.
33
34Of cause, there are a few vendor offering proprietary drives with
35slight advantages in performance and capacity, but they have
36significat disadvantages:
37
38- proprietary (single vendor)
39- a much higher purchase cost
40
41So we currently do no test such drives.
5f79dc28
DM
42
43In general, LTO tapes offer the following advantages:
44
45- Durable (30 years)
46- High Capacity (12 TB)
47- Relatively low cost per TB
48- Cold Media
49- Movable (storable inside vault)
50- Multiple vendors (for both media and drives)
d5efa18a 51
a174854a 52Please note that `Proxmox Backup Server` already stores compressed
54d96866
DM
53data, so we do not need/use the tape compression feature. Same applies
54to encryption.
55
d5efa18a
DM
56
57Supported Hardware
58------------------
59
60Proxmox Backup Server supports `Linear Tape Open`_ genertion 3
61(LTO3) or later. In general, all SCSI2 tape drives supported by
62the Linux kernel should work.
63
64Tape changer support is done using the Linux 'mtx' command line
65tool. So any changer devive supported by that tool work work.
66
67
8a192bed
DM
68Drive Performance
69~~~~~~~~~~~~~~~~~
70
71Current LTO8 tapes provide read/write speeds up to 360MB/s. Please
72note that it still takes a minimum of 9 hours to completely write or
73read a single tape (even at maximum speed).
74
75The only way to speed up that data rate is to use more than one
76drive. That way you can run several backup jobs in parallel, or run
77restore jobs while the other dives are used for backups.
78
baefbc44
DM
79Also consider that you need to read data first from your datastore
80(disk). But a single spinning disk is unable to deliver data at this
81rate. We meassured a maximum rate about 100MB/s in practive, so it
82takes 33 hours to read 12TB to fill up a LTO8 tape. So if you want to
83run your tape at full speed, please make sure that the source
84datastore is able to delive that performance (use SSDs).
85
d5efa18a
DM
86
87Terminology
88-----------
89
90:Tape Labels: are used to uniquely indentify a tape. You normally use
91 some sticky paper labels and apply them on the front of the
92 cartridge. We additionally store the label text magnetically on the
93 tape (first file on tape).
94
95.. _Code 39: https://en.wikipedia.org/wiki/Code_39
96
97.. _LTO Ultrium Cartridge Label Specification: https://www.ibm.com/support/pages/ibm-lto-ultrium-cartridge-label-specification
98
8001c82e
DM
99.. _LTO Barcode Generator: lto-barcode/index.html
100
d5efa18a
DM
101:Barcodes: are a special form of tape labels, which are electronically
102 readable. Most LTO tape robots use an 8 character string encoded as
103 `Code 39`_, as definded in the `LTO Ultrium Cartridge Label
104 Specification`_.
105
106 You can either bye such barcode labels from your cartidge vendor,
8001c82e
DM
107 or print them yourself. You can use our `LTO Barcode Generator`_ App
108 for that.
d5efa18a
DM
109
110.. Note:: Physical labels and the associated adhesive shall have an
111 environmental performance to match or exceed the environmental
112 specifications of the cartridge to which it is applied.
113
114:Media Pools: A media pool is a logical container for tapes. A backup
115 job targets one media pool, so a job only uses tapes from that
116 pool. The pool aditionally defines how long we can append data to a
117 tape (allocation policy), and how long we want to keep that data
118 (retention policy).
119
120:Tape drive: The decive used to read and write data to the tape. There
121 are standalone drives, but drives often ship within tape libraries.
122
123:Tape changer: A device which can change the tapes inside a tape drive
124 (tape robot). They are usually part of a tape library.
125
126.. _Tape Library: https://en.wikipedia.org/wiki/Tape_library
127
128:`Tape library`_: A storage device that contains one or more tape drives,
129 a number of slots to hold tape cartridges, a barcode reader to
130 identify tape cartridges and an automated method for loading tapes
131 (a robot).
132
133 People als call this 'autoloader', 'tape robot' or 'tape jukebox'.
8a192bed
DM
134
135
136Tape Quickstart
137---------------
138
1391. Configure your tape hardware (drives and changers)
140
1412. Configure one or more media pools
142
1433. Label your tape cartridges.
144
1454. Start your first tape backup job ...
baefbc44
DM
146
147
148Configuration
149-------------
150
151Please note that you can configure anything using the graphical user
152interface or the command line interface. Both methods results in the
153same configuration.
154
155
156Tape changers
157~~~~~~~~~~~~~
158
159Tape changers (robots) are part of a `Tape Library`_. You can skip
160this step if you are using a standalone drive.
161
162Linux is able to auto detect those devices, and you can get a list
a174854a 163of available devices using::
baefbc44
DM
164
165 # proxmox-tape changer scan
a174854a
DM
166 ┌─────────────────────────────┬─────────┬──────────────┬────────┐
167 │ path │ vendor │ model │ serial │
168 ╞═════════════════════════════╪═════════╪══════════════╪════════╡
169 │ /dev/tape/by-id/scsi-CC2C52 │ Quantum │ Superloader3 │ CC2C52 │
170 └─────────────────────────────┴─────────┴──────────────┴────────┘
baefbc44
DM
171
172In order to use that device with Proxmox, you need to create a
04eba29c 173configuration entry::
baefbc44 174
a174854a 175 # proxmox-tape changer create sl3 --path /dev/tape/by-id/scsi-CC2C52
baefbc44
DM
176
177Where ``sl3`` is an arbitrary name you can choose.
178
04eba29c 179.. Note:: Please use stable device path names from inside
baefbc44
DM
180 ``/dev/tape/by-id/``. Names like ``/dev/sg0`` may point to a
181 different device after reboot, and that is not what you want.
182
a174854a 183You can show the final configuration with::
baefbc44 184
04eba29c
DM
185 # proxmox-tape changer config sl3
186 ┌──────┬─────────────────────────────┐
187 │ Name │ Value │
188 ╞══════╪═════════════════════════════╡
189 │ name │ sl3 │
190 ├──────┼─────────────────────────────┤
191 │ path │ /dev/tape/by-id/scsi-CC2C52 │
192 └──────┴─────────────────────────────┘
193
194Or simply list all configured changer devices::
195
baefbc44 196 # proxmox-tape changer list
a174854a
DM
197 ┌──────┬─────────────────────────────┬─────────┬──────────────┬────────────┐
198 │ name │ path │ vendor │ model │ serial │
199 ╞══════╪═════════════════════════════╪═════════╪══════════════╪════════════╡
200 │ sl3 │ /dev/tape/by-id/scsi-CC2C52 │ Quantum │ Superloader3 │ CC2C52 │
201 └──────┴─────────────────────────────┴─────────┴──────────────┴────────────┘
baefbc44
DM
202
203The Vendor, Model and Serial number are auto detected, but only shown
204if the device is online.
205
a174854a
DM
206To test your setup, please query the status of the changer device with::
207
208 # proxmox-tape changer status sl3
209 ┌───────────────┬──────────┬────────────┬─────────────┐
210 │ entry-kind │ entry-id │ changer-id │ loaded-slot │
211 ╞═══════════════╪══════════╪════════════╪═════════════╡
212 │ drive │ 0 │ vtape1 │ 1 │
213 ├───────────────┼──────────┼────────────┼─────────────┤
214 │ slot │ 1 │ │ │
215 ├───────────────┼──────────┼────────────┼─────────────┤
216 │ slot │ 2 │ vtape2 │ │
217 ├───────────────┼──────────┼────────────┼─────────────┤
218 │ ... │ ... │ │ │
219 ├───────────────┼──────────┼────────────┼─────────────┤
220 │ slot │ 16 │ │ │
221 └───────────────┴──────────┴────────────┴─────────────┘
222
0912878e
DM
223Tape libraries usually provide some special import/export slots (also
224called "mail slots"). Tapes inside those slots are acessible from
225outside, making it easy to add/remove tapes to/from the library. Those
226tapes are considered to be "offline", so backup jobs will not use
227them. Those special slots are auto-detected and marked as
228``import-export`` slot in the status command.
229
230It's worth noting that some of the smaller tape libraries don't have
231such slots. While they have something called "Mail Slot", that slot
232is just a way to grab the tape from the gripper. But they are unable
233to hold media while the robot does other things. They also do not
234expose that "Mail Slot" over the SCSI interface, so you wont see them in
235the status output.
236
237As a workaround, you can mark some of the normal slots as export
238slot. The software treats those slots like real ``import-export``
239slots, and the media inside those slots is considered to be 'offline'
240(not available for backup)::
241
242 # proxmox-tape changer update sl3 --export-slots 15,16
243
244After that, you can see those artificial ``import-export`` slots in
245the status output::
246
04eba29c 247 # proxmox-tape changer status sl3
0912878e
DM
248 ┌───────────────┬──────────┬────────────┬─────────────┐
249 │ entry-kind │ entry-id │ changer-id │ loaded-slot │
250 ╞═══════════════╪══════════╪════════════╪═════════════╡
251 │ drive │ 0 │ vtape1 │ 1 │
252 ├───────────────┼──────────┼────────────┼─────────────┤
253 │ import-export │ 15 │ │ │
254 ├───────────────┼──────────┼────────────┼─────────────┤
255 │ import-export │ 16 │ │ │
256 ├───────────────┼──────────┼────────────┼─────────────┤
257 │ slot │ 1 │ │ │
258 ├───────────────┼──────────┼────────────┼─────────────┤
259 │ slot │ 2 │ vtape2 │ │
260 ├───────────────┼──────────┼────────────┼─────────────┤
261 │ ... │ ... │ │ │
262 ├───────────────┼──────────┼────────────┼─────────────┤
263 │ slot │ 14 │ │ │
264 └───────────────┴──────────┴────────────┴─────────────┘
a174854a 265
baefbc44
DM
266
267Tape drives
268~~~~~~~~~~~
269
04eba29c
DM
270Linux is able to auto detect tape drives, and you can get a list
271of available tape drives using::
272
273 # proxmox-tape drive scan
274 ┌────────────────────────────────┬────────┬─────────────┬────────┐
275 │ path │ vendor │ model │ serial │
276 ╞════════════════════════════════╪════════╪═════════════╪════════╡
277 │ /dev/tape/by-id/scsi-12345-nst │ IBM │ ULT3580-TD4 │ 12345 │
278 └────────────────────────────────┴────────┴─────────────┴────────┘
279
280In order to use that drive with Proxmox, you need to create a
281configuration entry::
282
283 # proxmox-tape drive create mydrive --path /dev/tape/by-id/scsi-12345-nst
284
285.. Note:: Please use stable device path names from inside
286 ``/dev/tape/by-id/``. Names like ``/dev/nst0`` may point to a
287 different device after reboot, and that is not what you want.
288
289If you have a tape library, you also need to set the associated
290changer device::
291
292 # proxmox-tape drive update mydrive --changer sl3 --changer-drive-id 0
293
294The ``--changer-drive-id`` is only necessary if the tape library
295includes more than one drive (The changer status command lists all
296drive IDs).
297
298You can show the final configuration with::
299
300 # proxmox-tape drive config mydrive
301 ┌─────────┬────────────────────────────────┐
302 │ Name │ Value │
303 ╞═════════╪════════════════════════════════╡
304 │ name │ mydrive │
305 ├─────────┼────────────────────────────────┤
306 │ path │ /dev/tape/by-id/scsi-12345-nst │
307 ├─────────┼────────────────────────────────┤
308 │ changer │ sl3 │
309 └─────────┴────────────────────────────────┘
310
311.. NOTE:: The ``changer-drive-id`` value 0 is not stored in the
312 configuration, because that is the default.
313
314To list all configured drives use::
315
316 # proxmox-tape drive list
317 ┌──────────┬────────────────────────────────┬─────────┬────────┬─────────────┬────────┐
318 │ name │ path │ changer │ vendor │ model │ serial │
319 ╞══════════╪════════════════════════════════╪═════════╪════════╪═════════════╪════════╡
320 │ mydrive │ /dev/tape/by-id/scsi-12345-nst │ sl3 │ IBM │ ULT3580-TD4 │ 12345 │
321 └──────────┴────────────────────────────────┴─────────┴────────┴─────────────┴────────┘
322
323The Vendor, Model and Serial number are auto detected, but only shown
324if the device is online.
325
632756b6
DM
326For testing, you can simply query the drive status with::
327
328 # proxmox-tape status --drive mydrive
329 ┌───────────┬────────────────────────┐
330 │ Name │ Value │
331 ╞═══════════╪════════════════════════╡
332 │ blocksize │ 0 │
333 ├───────────┼────────────────────────┤
334 │ status │ DRIVE_OPEN | IM_REP_EN │
335 └───────────┴────────────────────────┘
336
337.. NOTE:: Blocksize should always be 0 (variable block size
338 mode). This is the default anyways.
339
baefbc44
DM
340
341Media Pools
342~~~~~~~~~~~
343
344
345Tape Jobs
346~~~~~~~~~
347
348
349Administration
350--------------
351
352Label Tapes
353~~~~~~~~~~~
354
8001c82e
DM
355By default, tape cartidges all looks the same, so you need to put a
356label on them for unique identification. So first, put a sticky paper
357label with some human readable text on the cartridge.
358
359If you use a `Tape Library`_, you should use an 8 character string
360encoded as `Code 39`_, as definded in the `LTO Ultrium Cartridge Label
361Specification`_. You can either bye such barcode labels from your
362cartidge vendor, or print them yourself. You can use our `LTO Barcode
363Generator`_ App for that.
364
365Next, you need to write that same label text to the tape, so that the
366software can uniquely identify the tape too.
367
368For a standalone drive, manually insert the new tape cartidge into the
369drive and run:
370
371 # proxmox-tape label --changer-id <label-text> --drive <drive-name>
372
373.. Note:: For safety reasons, this command fails if the tape contain
374 any data. If you want to overwrite it anways, erase the tape first.
375
376You can verify success by reading back the label:
377
378 # proxmox-tape read-label --drive <drive-name>
379
380If you have a tape library, apply the sticky barcode label to the tape
381cartridges first. Then load those empty tapes into the library. You
382can then label all unlabeled tapes with a single command:
383
384 # proxmox-tape barcode-label --drive <drive-name>
385
386
baefbc44
DM
387Run Tape Backups
388~~~~~~~~~~~~~~~~
389
390Restore from Tape
391~~~~~~~~~~~~~~~~~
392
393Update Inventory
394~~~~~~~~~~~~~~~~
395
396Restore Catalog
397~~~~~~~~~~~~~~~