Amanda-Users

tapeless backup

2003-03-04 09:02:35
Subject: tapeless backup
From: "Jim Mozley" <jim.mozley AT exponential-e DOT com>
To: <amanda-users AT amanda DOT org>
Date: Tue, 4 Mar 2003 12:18:08 -0000
for archive searches: tapeless disk backup howto cookbook

I've put together the following instructions for installing AMANDA on a
Solaris server to perform backups to disk based on searching this list's
archives. I couldn't find everything in one place and read several requests
for a howto or volunteers to produce one; here's my contribution.

Thanks to the people who posted info to amanda-users that I used for this
and the chapter in the o'Reilly unix backup book. Any mistakes here are
mine.

This covers an initial installation and configuration. I've tested it to the
point of performing a backup. It still needs the install procedure verifying
during a second run through, a restore example documenting and installation
on backup client servers detailing. Any feedback welcome, I don't make any
form of claim to being an AMANDA expert, I just find that in my old age I
need to write things down ;-). I probably need to add the usual disclaimer
that I cannot guarantee the accuracy of this so please don't just copy what
I've done, its only a test set-up.

Jim


__________________________________________________________

Setting up AMANDA to backup to a series of disk files for tapeless backup.



Preparation

------------



The following pre-requisite packages were downloaded from
www.sunfreeware.com and installed using package add.



tar-1.13.19-sol8-sparc-local.gz

gawk-3.1.0-sol8-sparc-local.gz

readline-4.2-sol8-sparc-local.gz





A group and user were added for AMANDA to execute as:



# groupadd backup

# useradd -m -d /your/amanda/home -g backup amanda



Allow the amanda user to have read access to the appropriate files to
perform the backup. This was accomplished by putting the amanda user in the
group sys as the raw device files are set up in this group with read only.
In this way we don't need to alter permissions on the device files which
could screw up something we don't know about, however, it gives the amanda
user a lot of power so must test running amanda with login shell of
/usr/noshell or similar.



Compile

--------



The software was compiled using gcc 3.2.2 (package
gcc-3.2.2-sol8-sparc-local.gz from www.sunfreeware.com) and gmake 3.8 (also
from sunfreeware make-3.80-sol8-sparc-local.gz).



Ensure that /usr/local/bin is in the PATH prior to /usr/ccs/bin as the
compile needs gmake (Solaris make fails).



For the build on the master server use:



#
./configure --with-user=amanda --with-group=backup --with-portrange=xxxxx,xx
xxx

# make

# make install



For the build on the client use:



TO BE ADDED - should be the same but with the client only option



Configure Server

-----------------



Create a directory for the AMANDA configuration files:



# mkdir -p /usr/local/etc/amanda

Leave this directory owned by root so that only the root user can alter
amanda's configuration file



Create directories to be used for a holding area and disk backups:



# mkdir /backup/holdingdisk  # assume this will be used as the staging area

Create directories that correspond to "tapes" we will label later:

# mkdir -p /backup/device/Daily01/data

# mkdir -p /backup/device/Daily02/data

# mkdir -p /backup/device/Daily03/data

etc. depending on how many tape you need

Ensure permissions on these files are OK for AMANDA to use them as backup
"tapes":

# chown -R amanada:backup /backup



Create directories for logging and other volatile info:



# mkdir -p /var/adm/amanda/Daily/curinfo

# touch /var/adm/Amanda/Daily/tapelist

# chown -R amanda:backup /var/adm/amanda



amanda.conf

-------------





Create the file /usr/local/etc/amanda/Daily/amanda.conf:



# start amanda.conf

org "Daily"                    # your organization name for reports

mailto "yourname AT domain DOT com"                        # space separated 
list
of operators at your site

dumpuser "amanda"      # the user to run dumps under



inparallel 4                    # maximum dumpers that will run in parallel
(max 63)

                                    # this maximum can be increased at
compile-time,

                                    # modifying MAX_DUMPERS in
server-src/driverio.h

dumporder "sssS"         # specify the priority order of each dumper

                                    #   s -> smallest size

                                    #   S -> biggest size

                                    #   t -> smallest time

                                    #   T -> biggest time

                                    #   b -> smallest bandwitdh

                                    #   B -> biggest bandwitdh

                                    # try "BTBTBTBTBTBT" if you are not
holding

                                    # disk constrained

netusage  600 Kbps      # maximum net bandwidth for Amanda, in KB per sec



dumpcycle 1                 # the number of days in the normal dump cycle

runspercycle 1              # the number of amdump runs in dumpcycle days

                                    # (4 weeks * 5 amdump runs per week --
just weekdays)

tapecycle 2 tapes          # the number of tapes in rotation

                                    # 4 weeks (dumpcycle) times 5 tapes per
week (just

                                    # the weekdays) plus a few to handle
errors that

                                    # need amflush and so we do not
overwrite the full

                                    # backups performed at the beginning of
the previous

                                    # cycle

### ### ###

# WARNING: don't use `inf' for tapecycle, it's broken!

### ### ###



bumpsize 20 Mb                       # minimum savings (threshold) to bump
level 1 -> 2

bumpdays 1                  # minimum days at each level

bumpmult 4                  # threshold = bumpsize * bumpmult^(level-1)



etimeout 300                # number of seconds per filesystem for
estimates.

#etimeout -600             # total number of seconds for estimates.

# a positive number will be multiplied by the number of filesystems on

# each host; a negative number will be taken as an absolute total time-out.

# The default is 5 minutes per filesystem.



dtimeout 1800              # number of idle seconds before a dump is
aborted.



ctimeout 30                  # maximum number of seconds that amcheck waits

                                    # for each client host



tapebufs 20



runtapes 1                    # number of tapes to be used in a single run
of amdump

tpchanger "chg-multi"    # the tape-changer glue script

changerfile "/usr/local/etc/amanda/Daily/changer.conf"

tapedev "file:/backup/device"     # the no-rewind tape device to be used



maxdumpsize -1                       # Maximum number of bytes the planner
will schedule

                                    # for a run (default: runtapes *
tape_length).

tapetype DISK-FILE               # what kind of tape it is (see tapetypes
below)

labelstr "^Daily[0-9][0-9]*$"    # label constraint regex: all tapes must
match



amrecover_do_fsf yes               # amrecover will call amrestore with the

                                                # -f flag for faster
positioning of the tape.

amrecover_check_label yes      # amrecover will call amrestore with the

                                                # -l flag to check the
label.

amrecover_changer "/dev/null"  # amrecover will use the changer if you
restore

                                                # from this device.



# holding disks



holdingdisk hd1 {

    comment "main holding disk"

    directory "/backup/holdingdisk"         # where the holding disk is

    use 5 Gb                  # how much space can we use on it

                                    # a non-positive value means:

                                    #        use all space but that value

    chunksize 1Gb          # size of chunk if you want big dump to be

                                    # dumped on multiple files on holding
disks

                                    #  N Kb/Mb/Gb split images in chunks of
size N

                                    #                The maximum value
should be

                                    #                (MAX_FILE_SIZE - 1Mb)

                                    #  0          same as INT_MAX bytes

    }





autoflush no



infofile "/var/adm/amanda/Daily/curinfo" # database DIRECTORY

logdir   "/var/adm/amanda/Daily"                       # log directory

indexdir "/var/adm/amanda/Daily/index" # index directory

tapelist "/var/adm/amanda/Daily/tapelist"            # list of used tapes





# tapetypes



define tapetype DISK-FILE {

            comment "Disk File"

            length 10 gbytes

}



# Dump types



define dumptype global {

            comment "Global definitions"

            index yes

            record yes

}



define dumptype hard-disk {

    global

    comment "standard dump of this filesystem always"

    holdingdisk no # do not use the holding disk

    compress none

    priority high

}



# network interfaces



define interface local {

    comment "a local disk"

    use 1000 kbps

}



define interface le0 {

    comment "10 Mbps ethernet"

    use 400 kbps

}

# end amanda.conf





Configure multi-changer

------------------------



Create the file /usr/local/etc/amanda/Daily/changer.conf:



# start of changer.conf

multieject 0

gravity 0

needeject 0

ejectdelay 0



statefile /var/adm/amanda/Daily/changer.stat



firstslot 1

lastslot 7



slot 1 file:/backup/device/Daily01

slot 2 file:/backup/device/Daily02

slot 3 file:/backup/device/Daily03

slot 4 file:/backup/device/Daily04

slot 5 file:/backup/device/Daily05

slot 6 file:/backup/device/Daily06

slot 7 file:/backup/device/Daily07

# end of changer.conf



Add tapes to backup cycle

---------------------------



# su amanda -c "/usr/local/sbin/amlabel Daily Daily01 slot 1"

# su amanda -c "/usr/local/sbin/amlabel Daily Daily02 slot 2"

etc.



Files are added to the appropriate /backup/device/data/Daily* to simulate a
tape, an "ls" of this directory will show this.



Client configuration

-------------------



This includes the client on the master server.



>From the Amanda source directory run the script that updates /etc/services
and /etc/inetd.conf and restart inetd.



# client-src/patch-system

# kill -HUP <PID of inetd>



Create the file .amandahosts in the amanda users home directory and put in
the FQDN of the master server and the username it will be connecting with
i.e. amanda. This file will contain a line such as:



server.domain.com     amanda



Alter permissions so only the amanda user can read or write to this file:



# chown amanda:backup .amandahosts

# chmod 600 .amandahosts



Once all steps are completed on the client add appropriate backups to the
/usr/local/etc/amanda/Daily/disklist file on the master server:



server.domain.com       /var      hard-disk



Then check all is OK:



# su amanda -c "/usr/local/sbin/amcheck Daily"


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