3 AMANDA FILE-DRIVER-USAGE HOWTO.
7 This document covers the use of the file-driver in AMANDA
8 2.4.3 and higher. Examples given here have been taken from a
9 SuSe-Linux-8.2-Pro-environment, using AMANDA 2.4.4p1 and the
10 snapshot 2.4.4p1-20031202.
12 Please adjust paths, configuration names and other parameters
15 Stefan G. Weichinger, November - December, 2003
19 Since release 2.4.3 AMANDA supports the usage of a output
20 driver called "file". See the AMANDA-man page, section
21 OUTPUT DRIVERS, for more information on its implementation.
22 As the name suggests, this driver uses files as virtual (or file)
23 tapes. Once created and labeled, these file tapes can be selected
24 and changed with the standard tape-changer-interface of the AMANDA
34 You can easily explore the rich features of AMANDA on
35 systems without tape drives.
37 - cheap installations.
38 Without buying a tape drive you can enjoy the benefits
39 of AMANDA and backup to a bunch of harddisks. You can
40 create CD/DVD-sized backups which you can burn onto optical
44 You can use the file-driver to backup onto a set of
45 file tapes hosted on a raid-system. Combined with
46 another AMANDA-configuration that dumps the file tapes to
47 real tapes, you can provide reliable backup with faster
58 This guide assumes you have setup the basic AMANDA-services
59 as described in the "INSTALL"-file.
61 The configuration in this HOWTO is called "daily".
62 The file tapes are also called "vtapes" in this document, which
63 stands for "virtual tapes".
65 Please be sure to understand the differences between holding disks and
66 file tapes. The two serve different purposes; holding disks allow for
67 parallelism of multiple DLE's being backed up while file tapes are a
68 replacement for physical tapes.
70 Before beginning you will need to decide on (a) dedicated part(s)
71 of your hard disk(s) for your file tape storage. While this space
72 could be spread among several file systems and hard disks, I
73 recommend to dedicate at least a specific partition, better a specific
74 physical harddisk to the task of keeping your vtapes.
75 The use of a dedicated disk will speed things up definitely.
77 The disk space you dedicate for your vtapes should NOT
78 be backed up by AMANDA. Also, for performance reasons there
79 should be NO holding disks on the same partition as the
80 vtapes, preferably not even on the same physical drive.
82 If you only have one harddisk, it will work out, too, but
83 you will suffer low performance due to massive head-moving
84 in your harddisk, resulting from copying data between the
91 Step 0. Prepare the filesystem(s) used for the tapes.
93 Decide on where to put your files, create the
94 appropriate partition(s) and filesystem(s) and mount them.
96 In our example we have the dedicated partition "hdc1",
97 mounted on /amandatapes for vtape storage.
101 /dev/hdc1 on /amandatapes type reiserfs (rw)
104 Make sure there is space left.
105 Determine the amount of space you will use.
108 Filesystem Size Used Avail Use% Mounted on
109 /dev/hdc1 20G 0G 20G 0% /amandatapes
111 In our example we have 20GB diskspace left on /amandatapes.
113 Step 1. Determine length and number of tapes
115 After deciding on the number of vtapes you want to create,
116 evenly allocate the available space among them.
118 Look at the following rule of thumb:
120 As many types file systems exhibit dramatically reduced performance
121 when they are nearly full I have chosen to allocate
122 only 90% of the available space. So we have:
124 (Available Space * 0.9) >= tapelength * tapecycle
127 This is a very conservative approach to make sure you don´t suffer
128 any performance drop due to a nearly-full-filesystem.
130 As it is uncommon for AMANDA to fill, or almost fill an entire tape
131 you may also wish to use more space than that.
133 So you could determine possible combinations of tapelength/tapecycle
134 with the more general formula:
136 Available Space >= tapelength * tapecycle
139 In our example we take the conservative approach:
141 20 GB * 0.9 = 18 GB to use and so we could create the
142 following combinations:
148 18 GB = ......... you get the picture.
150 Using only one tape is generally considered a bad idea
151 when it comes to backup, so we should use at least 3
152 tapes (for testing purposes), better 6 or more tapes.
154 18 GB = 3 GB * 6 so we get the value 3GB for the
155 tapelength if we want to use 6 tapes.
157 Step 2. Create a tapetype definition.
159 Add a new tapetype definition similar to the following to your amanda.conf.
160 I named my definition "HARD-DISK". Choose whatever name you
161 consider appropriate.
163 define tapetype HARD-DISK {
164 comment "Dump onto hard disk"
165 length 3072 mbytes # specified in mbytes to get the exact size of 3GB
168 You don´t have to specify the "speed"-parameter (as it is
169 commonly listed in tapetype definitions and reported by
170 the program "amtapetype"). AMANDA does not use this parameter.
172 There is also an optional "filemark"-parameter, which indicates
173 the amount of space wasted after each tape-section. Leave it
174 blank and AMANDA uses the default of 1KB.
176 Step 3. Think about tapechangers.
178 As you will use a set of vtapes, you have to also use a kind of vtape-changer.
179 There are several tape-changer-scripts included in the AMANDA-tarball.
180 Read more about tape-changer-scripts in TAPE.CHANGERS.
182 Right now there are two scripts that can be used with vtapes.
183 These scripts take different approaches to the handling of tapes.
185 The script chg-multi handles many drives with a tape in each drive.
186 The script chg-disk handles a library with one drive and multiple tapes.
188 So with vtapes you could look at it this way:
190 chg-multi simulates multiple tape drives with one tape in each drive.
191 chg-disk simulates one tape-library with multiple tapes in.
193 As chg-multi exists for a much longer time than chg-disk, it is still
194 used in many AMANDA-vtape-installations.
196 chg-disk was introduced with the snapshot 20031202.
197 Contrary to chg-multi, which is a generic changer-script that must
198 be somewhat adjusted to the use of the file-driver, chg-disk offers
199 exactly the behavior needed for handling vtapes
201 IMHO the approach is much more logical, so I recommend to use chg-disk
202 in new AMANDA-vtape-installations.
204 To use chg-disk you need to have at least amanda-2.4.4p1-20031202.
206 Choose the one that fits your way of vtape-handling and -maintenance.
208 In this HOWTO I only cover the use of chg-disk.
209 Usage of chg-multi is pretty similar and will maybe covered in a later
210 version of this document.
212 Step 4. Set up your tape-config.
214 In the general section you have to set the parameters tapecycle,
215 tapetype, tpchanger, changerfile, tapedev, rawtapedev and changerdev.
219 $ vi /usr/local/etc/amanda/daily/amanda.conf
225 changerfile "/usr/local/etc/amanda/daily/changer"
226 tapedev "file:/amandatapes/daily"
228 This reflects the use of your defined tapetype.
230 The "tapecycle"-parameter tells AMANDA how much tapes can be used.
231 Set this value according to the number of tapes you want to use.
233 The "tapetype"-parameter points to the tapetype definition you have
236 The "tpchanger"-parameter tells AMANDA to use the generic
237 tape-changer-script to handle the virtual tapes. You
238 can think of it as a virtual tape-changer-device.
240 The "changerfile"-parameter is used to give chg-disk the "prefix"
241 for the "%s-changer, %s-clean, %s-slot" files it needs.
242 Use something like "changer" in your config-dir.
243 Please note that this file does NOT have to exist, but it won't
246 The "tapedev"-parameter tells the chg-disk-script where the
247 root-dir for your vtapes is.
248 In our example the vtape-files go to
249 /amandatapes, and to separate multiple configurations we decided
250 to use subdirectories according to the configuration name "daily".
252 Step 5. Create the virtual tapes.
254 Now you have to create the tape-directories.
255 chg-disk needs a directory structure like:
265 where 'slot_root_dir' is the tapedev 'file:xxx' parameter
266 and 'n' is the tapecycle parameter.
268 So in our example we do:
270 $ mkdir /amandatapes/daily
272 for the 'slot_root_dir' and
274 $ mkdir /amandatapes/daily/slot1
275 $ mkdir /amandatapes/daily/slot2
278 for the virtual slots that will later contain the vtapes.
280 If you have many vtapes to create and their names follow a pattern
281 you may be able to do them all with a single loop such as:
283 $ for n in 1 2 3 4 5 6 7 8 9 10 11 12
285 > mkdir /amandatapes/daily/slot${n}
288 Create the info-file:
290 $ touch /amandatapes/daily/info
292 and link the first slot to the data-file (to "load" the vtape
295 $ ln -s /amandatapes/daily/slot1 /amandatapes/daily/data
297 Make sure the AMANDA-user has write-permissions on these directories:
299 $ chown -R <amanda_user> /amandatapes
300 $ chgrp -R <amanda_group> /amandatapes
301 $ chmod -R 750 /amandatapes
303 Step 8. Label the virtual tapes.
305 As the virtual tapes are handled just like physical
306 tapes by the AMANDA-Server they have to be labeled
309 Usage: amlabel [-f] <conf> <label> [slot <slot-number>]
313 $ amlabel daily daily1 slot 1
315 $ amlabel daily daily2 slot 2
318 If you have many vtapes to label and their names follow a pattern
319 you may be able to do them all with a single loop such as:
321 $ for n in 01 02 03 04 05 06 07 08 09 10 11 12
323 > amlabel daily daily${n} slot ${n}
326 Label all your created tapes according to the
327 "labelstr"-parameter in your amanda.conf. Consult the
328 amlabel-man-page for details.
330 Step 9. Test your setup with amcheck.
332 Run amcheck daily (or, more general, amcheck <config>)
333 and look for anything AMANDA complains about.
335 A proper output looks like:
338 Amanda Tape Server Host Check
339 -----------------------------
340 Holding disk /amhold: 6924940 KB disk space available,
342 amcheck-server: slot 2: date 20031115 label daily02
344 NOTE: skipping tape-writable test
345 Tape daily02 label ok
346 Server check took 0.377 seconds
348 Recheck your files if errors occur.
353 THAT'S IT! YOU ARE READY TO RUN, UNLESS WE FORGOT
354 SOMETHING. PLEASE send mail to amanda-users@amanda.org if
355 you have any comments or questions. We're not afraid of
356 negative reviews, so let us have it!