59fb602950116c07308ac84ed7c27476497d44c4
[debian/amanda] / man / xml-source / amanda-devices.7.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3                    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
4 [
5   <!-- entities files to use -->
6   <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
7   %global_entities;
8 ]>
9
10 <refentry id='amanda-devices.7'>
11
12 <refmeta>
13 <refentrytitle>amanda-devices</refentrytitle>
14 <manvolnum>7</manvolnum>
15 &rmi.source;
16 &rmi.version;
17 &rmi.manual.7;
18 </refmeta>
19 <refnamediv>
20 <refname>amanda-devices</refname>
21 <refpurpose>Configuring and Using Amanda Devices</refpurpose>
22 </refnamediv>
23 <refentryinfo>
24 &author.ian;
25 &author.dustin;
26 </refentryinfo>
27 <!-- body begins here -->
28
29 <refsect1><title>DESCRIPTION</title>
30
31 <para>The Device API specifies a generic interface between Amanda and storage
32 devices such as tapes or disks.  This manual page describes the device
33 drivers included with Amanda.</para>
34
35 <para>This is a <emphasis>user-level</emphasis> description of the API, and
36 does not address details that are only of concern to developers.  For that
37 purpose, consult the Amanda source code and http://wiki.zmanda.com.</para>
38
39 <para>The term "device driver" describes the software that can communicate with
40 some kind of backend storage, e.g., a tape driver.  A "device" is the
41   storage element itself, usually a piece of hardware. When discussing
42   a device and its driver as a unit, the term  "device" is sometimes
43   also used to refer to the combination of device and driver.</para>
44
45
46 </refsect1>
47
48 <refsect1><title>SPECIFYING DEVICES</title>
49
50 <para>Device names take the form <emphasis>TYPE:NODE</emphasis>, where <emphasis>TYPE</emphasis> selects a device driver, and <emphasis>NODE</emphasis> provides further information to that driver.  The syntax for each device driver is given in the corresponding section below.</para>
51
52 <para>Devices are described in &amconf; with "device" sections, e.g.,
53 <programlisting>
54 define device top_drive {
55     tapedev "tape:/dev/nst0"
56     device_property "BLOCK_SIZE" "131072"
57 }
58 </programlisting>
59 A device defininition creates a device "alias", in this case named <emphasis>top_drive</emphasis>, which can then be named in the global <emphasis>tapedev</emphasis> parameter:
60 <programlisting>
61 tapedev "top_drive"
62 </programlisting>
63 </para>
64
65 <para>The global <emphasis>tapedev</emphasis> parameter can also specify a literal device name.  For example,
66 <programlisting>
67 tapedev "file:/amdisks"
68 </programlisting>
69 is equivalent to
70 <programlisting>
71 tapedev "default"
72 define device default {
73     tapedev "file:/amdisks"
74 }
75 </programlisting>
76 Device properties specified outside of any device definition apply to all devices.  This syntax is provided mainly for backward compatibility, and for simple Amanda configurations.  Note that there is no way to provide properties specific to a device without defining a device alias.</para>
77
78 <para>See <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>
79 for more information on Amanda configuration.</para>
80
81 </refsect1>
82
83 <refsect1><title>DEVICES</title>
84
85 <para>This section lists the device drivers included with Amanda, and basic instructions for using them.  For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com.</para>
86
87 <refsect2><title>Null Device</title>
88 <programlisting>
89 tapedev "null:"
90 </programlisting>
91
92 <para>The null device driver only supports writing, and discards all data.  It is
93 generally only useful for testing purposes.</para>
94
95 </refsect2>
96
97 <refsect2><title>RAIT Device</title>
98 <programlisting>
99 tapedev "rait:tape:/dev/rmt/tps0d{4,5,6}n"
100 </programlisting>
101
102 <para>The RAIT device driver mirrors or stripes data over multiple "child" devices.
103 The child devices are specified using a shell-like syntax, where alternatives
104 are enclosed in braces and separated by commas.</para>
105
106 <para>With two child devices, the RAIT device driver mirrors data such that the
107 two devices contain identical data and can be used singly for
108   recovery.  With more than two devices, the RAIT device "stripes"
109   data across all but one device and writes a parity block to the
110   final device, usable for data recovery in the event of a device or
111   volume failure.  The RAIT device scales its blocksize as necessary
112   to match the number of children that will be used to store data.</para>
113
114 <para>When a child device is known to have failed, the RAIT device should be reconfigured to replace that device with the text "ERROR", e.g.,
115 <programlisting>
116 tapedev "rait:{tape:/dev/st0,ERROR,tape:/dev/st2}"
117 </programlisting>
118 This will cause the RAIT device to start up in degraded mode, reconstructing the data from the missing device.
119 </para>
120
121 <para>Like ordinary RAID drivers, the RAIT device driver can automatically
122 enter degraded mode when one of its child devices fails.  However, the RAIT
123 device cannot automatically recover from any write error nor write any data in
124 degraded mode.  When reading, certain errors may be fatal (rather than causing
125 degraded mode).  And in any case, labels on all volumes must initially match
126 (labeled or otherwise).  If you have lost one volume from a set, explicitly
127 start the device in degraded mode as described above.</para>
128
129 <refsect3><title>Child Device Block Sizes</title>
130
131 <para>The RAIT device driver requires that all of its child devices use the
132 same block size.  If no block sizes are specified, the driver selects the block
133 size closest to 32k that is within the MIN_BLOCK_SIZE - MAX_BLOCK_SIZE range of
134 all child devices, and calculates its own blocksize according to the formula
135 <emphasis>rait_blocksize = child_blocksize * (num_children - 1)</emphasis>.  If
136 a block size is specified for the RAIT device, then it calculates its child
137 block sizes according to the formula <emphasis>child_blocksize = rait_blocksize
138 / (num_children - 1)</emphasis>.  Either way, it sets the BLOCK_SIZE property
139 of each child device accordingly.</para>
140
141 </refsect3>
142
143 </refsect2>
144
145 <refsect2><title>S3 Device</title>
146 <programlisting>
147 tapedev "s3:foocorp-backups/DailySet1-"
148 device_property "S3_ACCESS_KEY" "MYACCESSKEY"
149 device_property "S3_SECRET_KEY" "MYSECRETKEY"
150 </programlisting>
151
152 <para>The S3 device driver uploads data to the Amazon S3 "storage cloud".  Its
153 device name is a slash-sparated combination of bucket name and prefix:
154 "s3:BUCKET/PREFIX".  Since buckets must be unique across all Amazon S3 users,
155 and since the number of buckets allowed to each user is limited, the driver can
156 store multiple Amanda volumes in a single S3 bucket, distinguished by prefix.
157 The prefix and slash can be omitted if they are not needed: "s3:BUCKET".</para>
158
159 <para>The access and secret keys used to authenticate to Amazon S3 are provided
160 as properties.</para>
161
162 <para>The S3 device driver stores each block in a distinct S3 object.  Due to
163 high HTTP overhead for each request, use of larger than normal block
164   sizes (&gt; 1 megabyte) is reccomended with the S3 device.</para>
165
166 <para>You can control where your data is physically stored by Amazon S3 using 
167 a location constraint. Setting this affects can affect both billing and legal 
168 concerns, so you are encouraged to consult Amazon's documentation for details.
169 </para>
170
171 <para>
172 To control location constraints, set the S3_BUCKET_LOCATION property.
173 Currently, there are two valid settings: "" (any location) and "EU" (Europe).
174 If the S3_BUCKET_LOCATION is set, Amanda will check to make sure that the 
175 setting agrees with the constraint currently on the bucket.
176 </para>
177
178 </refsect2>
179
180 <refsect2><title>Tape Device</title>
181 <programlisting>
182 tapedev "tape:/dev/nst0"
183 </programlisting>
184
185 <para>The tape device driver interacts with a tape drive.  The device uses the
186 operating system's built-in tape support, which is generally similar to that
187 available via the command-line utilities dd(1) and mt(1).</para>
188
189 <para>The tape device name should specify a path to the operating system's
190 device file.</para>
191
192 </refsect2>
193
194 <refsect2><title>VFS Device</title>
195 <programlisting>
196 tapedev "file:/path/to/vtape"
197 </programlisting>
198
199 <para>The VFS device driver stores data on a UNIX filesystem. Note
200   that although one typically uses the VFS device driver to store data
201   on hard disks, the driver does not interface with any hardware on a
202   block level.</para>
203
204 <para>The device name specifies a path to a directory which must exist and
205 contain a "data/" subdirectory.  Each tape file is stored as a distinct file in
206 this directory, the name of which reflects the Amanda header in the tape file.
207 Block boundaries are not maintained: the driver supports reads of arbitrary
208 size, regardless of the blocksize used to write the data.</para>
209
210 </refsect2>
211
212 </refsect1>
213
214 <refsect1><title>PROPERTIES</title>
215
216 <para>Device drivers use <emphasis>properties</emphasis> as a generic means to
217 interact with other parts of Amanda.  Some properties are set by the device
218 driver and used by Amanda to determine how its devices should be used.  Other
219 properties can be set by Amanda or by the user to influence the driver's
220 behavior. Properties are set for a particular device, so that if you have two
221 tape devices, they will not share property values.</para>
222
223 <para>Properties are specified in <emphasis>amanda.conf</emphasis> with the
224 <emphasis>device-property</emphasis> parameter.  The syntax looks like this:
225 <programlisting>
226 device_property "FROBNICATOR_PATH" "/var/frobd/state"
227 device_property "BYTES_PER_FORTNIGHT" "128k"
228 device_property "USE_QUBITS" "no"
229 </programlisting></para>
230
231 <para>Both the property name and the property value are always quoted.  String
232 values are given as simple strings, like FROBNICATOR_PATH in the example above.
233 Integer values can be specified with any of the suffixes given in the "VALUE
234 SUFFIXES" section of &amconf;, like BYTES_PER_FORTNIGHT, above.  Boolean values
235 can be specified as any of "true", "yes", "1", "0", "no", "false", like
236 USE_QUBITS, above.  Some properties have special formats, as described
237 below.</para>
238
239 <para>Some properties are set based on other configuration values, such as
240 tapetype parameters.  These special cases are detailed under the appropriate
241 property, below.</para>
242
243 <para>The order in which device properties are set is as follows:
244 <orderedlist>
245 <listitem><para>Tapetype parameters (including length, blocksize, and readblocksize) are translated into device properties and set accordingly.</para></listitem>
246 <listitem><para>Device properties from any device_property
247     configuration parameters are set, in the order they appear in the
248     configuration file.</para>
249 </listitem>
250 </orderedlist></para>
251
252 <para>Properties described as read-only are not accessible to users.  They are
253 listed here for completeness.</para>
254
255 <refsect2><title>COMMON PROPERTIES</title>
256
257 <para>Note that some of these properties are currently unused, and present only
258 for future expansion.  Not all devices implement all of these properties.</para>
259
260 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
261
262 <variablelist>
263  <!-- ==== -->
264  <varlistentry><term>APPENDABLE</term><listitem>
265  (read-only) This boolean property indicates whether this device supports appending data to volumes.
266 </listitem></varlistentry>
267  <!-- ==== -->
268  <varlistentry><term>BLOCK_SIZE</term><listitem>
269  (read-write) This property gives the block size, in bytes, that will be used to write to the device.  The usual suffixes ("kbytes", etc.) are allowed.  The tapetype parameter <emphasis>blocksize</emphasis> sets this property.
270 </listitem></varlistentry>
271  <!-- ==== -->
272  <varlistentry><term>CANONICAL_NAME</term><listitem>
273  (read-only) This property contains the full canonical name for this device.  This name may not be the same as the user-supplied name, but is a valid name by which to access this device.
274 </listitem></varlistentry>
275  <!-- ==== -->
276  <varlistentry><term>COMPRESSION</term><listitem>
277  (read-write) This boolean property represents the compression status of the device, and can be used to enable and disable such compression.  This applies mostly to tape devices, although many tape devices do not support setting compression from software.
278 </listitem></varlistentry>
279  <!-- ==== -->
280  <varlistentry><term>COMPRESSION_RATE</term><listitem>
281  (read-only) This property gives the compression rate, as a decimal ratio.  It may be a measured value over some unspecified period or a simple estimate.
282 </listitem></varlistentry>
283  <!-- ==== -->
284  <varlistentry><term>CONCURRENCY</term><listitem>
285  (read-only) This property indicates the level of concurrent access that this device supports.
286 </listitem></varlistentry>
287  <!-- ==== -->
288  <varlistentry><term>FREE_SPACE</term><listitem>
289  (read-only) This property gives the amount of free space available on the current volume, if known.  This is often an estimate; for example, tape devices can only estimate the amount of tape left on a spool.
290 </listitem></varlistentry>
291  <!-- ==== -->
292  <varlistentry><term>MAX_BLOCK_SIZE</term><listitem>
293  (read-only) This property gives the maximum block size this device can support.  See BLOCK SIZES, below.
294 </listitem></varlistentry>
295  <!-- ==== -->
296  <varlistentry><term>MEDIUM_ACCESS_TYPE</term><listitem>
297  (read-only) This property gives the type of the media in the device: read only, WORM (Write Once, Read Many), read/write, or write only.  Write-only devices do not support recovery, but the data are not necessarily thrown out.
298 </listitem></varlistentry>
299  <!-- ==== -->
300  <varlistentry><term>MIN_BLOCK_SIZE</term><listitem>
301  (read-write) This property gives the minimum block size this device can support.  See BLOCK SIZES, below.
302 </listitem></varlistentry>
303  <!-- ==== -->
304  <varlistentry><term>MAX_VOLUME_USAGE</term><listitem>
305  (read-write) On devices that support it, this property will limit the total amount of data written to a volume; attempts to write beyond this point will cause the device to simulate "out of space."  Zero means no limit.  The tapetype parameter <emphasis>length</emphasis> sets this property.
306 </listitem></varlistentry>
307  <!-- ==== -->
308  <varlistentry><term>PARTIAL_DELETION</term><listitem>
309  (read-only) This property indicates whether the device supports deletion of specific files.  Aside from linear tapes, most devices can support this feature.  It is currently unused by Amanda.
310 </listitem></varlistentry>
311  <!-- ==== -->
312  <varlistentry><term>STREAMING</term><listitem>
313  (read-only) This property gives the streaming requirement for this device.  For example, tape drives often require a steady supply of data to avoid shoe-shining, while disk devices have no such requirement.
314 </listitem></varlistentry>
315  <!-- ==== -->
316  <varlistentry><term>VERBOSE</term><listitem>
317  (read-write) If this boolean property is set, then the device will produce verbose debugging output.  This property is not recognized by all devices.
318 </listitem></varlistentry>
319  <!-- ==== -->
320 </variablelist>
321
322 <refsect3><title>BLOCK SIZES</title>
323
324 <para>Amanda writes device data in blocks. On most devices the block
325 boundaries are embedded in the media along with the data itself, so subsequent
326 reads must use the same block sizes.  On tape devices, the block size is
327 dictated by the capabilities of the hardware -- buffer sizes, physical format,
328 and so on.</para>
329
330 <para>Amanda has historically supported a single, fixed block size -- usually
331 32k.  The Device API adds the ability to specify a block size at runtime, using
332 the BLOCK_SIZE property.  Devices provide MIN_BLOCK_SIZE and MAX_BLOCK_SIZE as
333 a guide to the range of acceptable block sizes. Note that this does not imply
334 that all sizes in the range MIN_BLOCK_SIZE - MAX_BLOCK_SIZE are available --
335 the device may require that block sizes are even multiples of some power of
336 two, for example.  Consult the documentation for your hardware and operating
337 system for more information.</para>
338
339 <para>Most devices are flexible enough to read a volume using a different block
340 size than that with which it was written.  This can be useful when handling old
341 volumes written with a smaller blocksize, or volumes of unknown blocksize.
342 Unfortunately, some tape devices do not detect oversized blocks correctly, and
343 may lose data if the configured block size is smaller than the volume's block
344 size.  The tape device driver has a READ_BUFFER_SIZE property which specifies
345 the minimum buffer size that will be allocated for reads from tape.  If the
346 hardware supports it, setting this property allows Amanda to correctly read
347 from tapes written with any blocksize less than or equal to READ_BUFFER
348 SIZE.</para>
349
350 <note><para>The RAIT device does not support flexible block sizes, as its
351 parity algorithm requires that all child devices have the same, fixed block
352 size.</para></note>
353
354 </refsect3>
355
356 </refsect2>
357
358 <refsect2><title>DRIVER-SPECIFIC PROPERTIES</title>
359
360 <refsect3><title>S3 Device</title>
361
362 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
363 <variablelist>
364  <!-- ==== -->
365  <varlistentry><term>S3_ACCESS_KEY</term><listitem>
366  (read-write) This property gives the Amazon S3 access key used to access the service.
367 </listitem></varlistentry>
368  <!-- ==== -->
369  <varlistentry><term>S3_BUCKET_LOCATION</term><listitem>
370  (read-write) Location constraint for buckets on Amazon S3.
371 Currently, it can be set to "", for no constraint (i.e. store data in the US), 
372 or "EU" (i.e. store data in the EU).
373 See Amazon's documentation for details and latest information
374 </listitem></varlistentry>
375  <!-- ==== -->
376  <varlistentry><term>S3_SECRET_KEY</term><listitem>
377  (read-write) This property gives the Amazon S3 secret key used to access the service.
378 </listitem></varlistentry>
379  <!-- ==== -->
380  <varlistentry><term>S3_SSL</term><listitem>
381  (read-write) Whether or not to use SSL/TLS to secure communications with Amazon S3.
382 </listitem></varlistentry>
383  <!-- ==== -->
384  <varlistentry><term>S3_USER_TOKEN</term><listitem>
385  (read-write) This property specifies the user token for Amanda Enterprise Edition customers.
386 </listitem></varlistentry>
387  <!-- ==== -->
388 </variablelist>
389
390 <para>Most Amanda devices work just fine without any properties, but not the S3
391 device.  A typical S3 configuration will have an access key and secret key
392 specified:
393
394 <programlisting>
395 device_property "S3_ACCESS_KEY" "27D3B8C6C4E7AA423C2B37C72A0D22C8"
396 device_property "S3_SECRET_KEY" "agphc2Q7Zmxragphc2RmO2xragpzZGY7a2xqCgr"
397 </programlisting></para>
398
399 </refsect3>
400
401 <refsect3><title>Tape Device</title>
402
403 <para>Most of these properties are automatically detected, but can be
404 overridden in the configuration file if the autodetection fails. Note that tape
405 drives are required to at least support the MTREW (rewind) operation; all other
406 operations can be emulated with the MTREW and read data operations.</para>
407
408 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
409 <variablelist>
410  <!-- ==== -->
411  <varlistentry><term>BROKEN_GMT_ONLINE</term><listitem>
412  (read-write) Set this boolean property if the system's GMT_ONLINE macro gives incorrect results.  This is currently true for the Linux IDE-TAPE driver.
413 </listitem></varlistentry>
414  <!-- ==== -->
415  <varlistentry><term>BSF</term><listitem>
416  (read-write) This boolean property specifies whether the device
417  driver may execute the MTBSF operation (backward seek file).
418 </listitem></varlistentry>
419  <!-- ==== -->
420  <varlistentry><term>BSF_AFTER_EOM</term><listitem>
421  (read-write) This boolean property specifies whether the device
422  driver should execute an MTBSF (backward seek file) operation after
423  MTEOM (seek to end of recorded data) in order to append.
424 </listitem></varlistentry>
425  <!-- ==== -->
426  <varlistentry><term>BSR</term><listitem>
427  (read-write) This boolean property specifies whether the device
428  driver may use the MTBSR operation (backward seek record).
429 </listitem></varlistentry>
430  <!-- ==== -->
431  <varlistentry><term>EOM</term><listitem>
432  (read-write) This boolean property specifies whether the device
433  driver may use the MTEOM command (seek to end of recorded data).
434 </listitem></varlistentry>
435  <!-- ==== -->
436  <varlistentry><term>FINAL_FILEMARKS</term><listitem>
437  (read-write) This integer property gives the number of filemarks that should be written at EOD.  It is usually 1 or 2.
438 </listitem></varlistentry>
439  <!-- ==== -->
440  <varlistentry><term>FSF</term><listitem>
441  (read-write) This boolean property specifies whether the device driver may use the MTFSF operation (forward seek file).
442 </listitem></varlistentry>
443  <!-- ==== -->
444  <varlistentry><term>FSF_AFTER_FILEMARK</term><listitem>
445  (read-write) This boolean property specifies whether the device driver needs a FSF to go the next file after the filemark is read. Default to "TRUE" on Solaris and "FALSE" on all others machines.
446 </listitem></varlistentry>
447  <!-- ==== -->
448  <varlistentry><term>FSR</term><listitem>
449  (read-write) This boolean property specifies whether the device driver may use the MTFSR operation (forward seek record).
450 </listitem></varlistentry>
451  <!-- ==== -->
452  <varlistentry><term>NONBLOCKING_OPEN</term><listitem>
453  (read-write) Set this boolean property to "true" if O_NONBLOCK must be used on the open call. Default to "true" on Linux and "false" on all others machines. Witout it, Linux wait for a few seconds if no tape are loaded. Solaris have strange error it is set to "yes".
454 </listitem></varlistentry>
455  <!-- ==== -->
456  <varlistentry><term>READ_BUFFER_SIZE</term><listitem>
457  (read-write) This property specifies the minimum buffer size that will be used for reads; this should be large enough to contain any block that may be read from the device, and must be larger than BLOCK_SIZE.  This property exists for tape devices which cannot determine the size of on-tape blocks, or which may discard data which overflows a small buffer.  The tapetype parameter <emphasis>READBLOCKSIZE</emphasis> sets this property.  See BLOCK SIZES, above.
458 </listitem></varlistentry>
459  <!-- ==== -->
460 </variablelist>
461
462 </refsect3>
463
464 </refsect2>
465
466 </refsect1>
467
468 <refsect1><title>SEE ALSO</title>
469 <para>
470 <citerefentry><refentrytitle>amanda.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
471 </para>
472
473 </refsect1>
474 </refentry>