Amanda-Users

Re: backup to USB Disk drives

2007-11-13 11:34:59
Subject: Re: backup to USB Disk drives
From: Paul Bijnens <Paul.Bijnens AT xplanation DOT com>
To: Jeremy Mordkoff <jlm AT zazzletech DOT com>
Date: Tue, 13 Nov 2007 17:26:08 +0100
On 2007-11-13 15:58, Jeremy Mordkoff wrote:
I am setting up backups to USB disk drives. I plan to take the drives home every week and rotate in a new one. I have the backups working, so my plan is to swap out the drive on Monday, mark all of the ‘tapes’ from the old drive as no-reuse and create 5 new ‘tapes’ using mkdir and amlabel, and by rewriting changer.conf

Is there anything on the ‘tapes’ that is needed to successfully perform the subsequent backups?
Did I miss any steps?

The way I implemented such a setup is like this:

Using hald, I set the usbdisk to mount it using the Volume label.
Then I also format the usbdisk with ext3fs, using a volumelabel
like:  amanda1, amanda2 (for two different disks, more if you like).
Haldaemon automounts these usbdisks on /media/amanda1, /media/amanda2
etc. Also, I configured hald to give user amanda permission to mount
and unmount the filesystem on the usbdisk.

Then I create a vtape directory structure for chg-multi on each disk.
The first disk contains vtapes 1-5, 11-15, and the second disk
contains vtapes 6-10, 16-20.:
    mkdir -p /media/amanda1/vtapes/daily/Daily-0{1,2,3,4,5}/data
    mkdir -p /media/amanda2/vtapes/daily/Daily-0{6,7,8,9}/data
    mkdir -p /media/amanda2/vtapes/daily/Daily-10/data
    mkdir -p /media/amanda1/vtapes/daily/Daily-1{1,2,3,4,5}/data
    mkdir -p /media/amanda2/vtapes/daily/Daily-1{6,7,8,9}/data
    mkdir -p /media/amanda2/vtapes/daily/Daily-20/data
   etc.
Then chg-multi.conf file contains the corresponding "slots":

slot  1 file:/media/amanda1/vtapes/daily/Daily-01
slot  2 file:/media/amanda1/vtapes/daily/Daily-02
slot  3 file:/media/amanda1/vtapes/daily/Daily-03
slot  4 file:/media/amanda1/vtapes/daily/Daily-04
slot  5 file:/media/amanda1/vtapes/daily/Daily-05
slot  6 file:/media/amanda2/vtapes/daily/Daily-06
slot  7 file:/media/amanda2/vtapes/daily/Daily-07
slot  8 file:/media/amanda2/vtapes/daily/Daily-08
slot  9 file:/media/amanda2/vtapes/daily/Daily-09
slot 10 file:/media/amanda1/vtapes/daily/Daily-10
slot 11 file:/media/amanda1/vtapes/daily/Daily-11
   etc.
slot 20 file:/media/amanda2/vtapes/daily/Daily-20

(note how 5 tapes are on one disk, the next 5 on the other disk etc)

Then, having the rest of amanda config files ready,
label the tapes:
   amlabel daily Daily-01 slot 1
   amlabel daily Daily-02 slot 2
   etc.
   amtape daily reset    # and make tape 1 current again!

So there are 5 disks for each day of the week.  When the disks
are exchanged once a week the next file vtapes will be used.
After 4 weeks (disks exchanged twice each), the cycle starts
over again.

There are some drawbacks to this approach:
- if you forget to exchange the disk one week, the backups can continue
on the same disk, skipping 5 vtapes, but you need to lower the
tapecycle by 10 (you may have more tapes than tapecycle:
tapecycle just indicates which tapes may not be overwritten).
- if you use the normal amanda scheduling, you get fulls and
incrementals mixed each day.  According to Murphy's laws, you will
probably need the disk from the previous week, having the last full
dump to restore; and that disk is offsite, remember.
A workaround is to start exchange the disks on friday, and start
the first run during the weekend with a "amadmin daily force",
and maybe do only incrementals during the rest of the week.
- If friday happens to be holiday, and you're not in the office,
and you want to exchange disks on thursday instead, that complete
cycle falls apart, because then the full will not end up in vtape
1,6,11,16 but on the oldest reusable vtape available instead...
- External USB-disks, in my experience, freuqently (once every few
weeks or so) suddenly get disconnected for no apparent reason.  In that
case I have powercycle the external disk, and then everything works
as expected again.  Having such a disconnect during the weekend,
doing full dumps, means that the rest of the full dumps continue
on the next run.  USB-disks are also not that fast, so that backup
takes some time during working hours as well.  And USB-disk traffic
does load the bus heavily (in my experience), making the server
in whole very unresponsive.

(I probably forgot some more issues...)

PS. Instead of chg-multi, you can also use chg-disk, and be
clever with symlinks.  But chg-disk mixes the concept of tapecycle
and number of vtapes that you have.
chg-disk asumes they are the same :-), which will result in amanda
refusing to overwrite a vtape when you forget to exchange the disk.

--
Paul Bijnens, xplanation Technology Services        Tel  +32 16 397.511
Technologielaan 21 bus 2, B-3001 Leuven, BELGIUM    Fax  +32 16 397.512
http://www.xplanation.com/          email:  Paul.Bijnens AT xplanation DOT com
***********************************************************************
* I think I've got the hang of it now:  exit, ^D, ^C, ^\, ^Z, ^Q, ^^, *
* F6, quit, ZZ, :q, :q!, M-Z, ^X^C, logoff, logout, close, bye, /bye, *
* stop, end, F3, ~., ^]c, +++ ATH, disconnect, halt,  abort,  hangup, *
* PF4, F20, ^X^X, :D::D, KJOB, F14-f-e, F8-e,  kill -1 $$,  shutdown, *
* init 0, kill -9 1, Alt-F4, Ctrl-Alt-Del, AltGr-NumLock, Stop-A, ... *
* ...  "Are you sure?"  ...   YES   ...   Phew ...   I'm out          *
***********************************************************************

<Prev in Thread] Current Thread [Next in Thread>