You are on page 1of 18

Amanda in 15 Minutes

Abstract
Amanda is the most popular open source backup and recovery software in the world because of its openness, robustness, functionality and scalability. Yet it is very easy to set up and maintain in production. This article illustrates how, in about 15 minutes, you can: Install and configure an Amanda backup server. Prepare three different client machines (SLES 11, Fedora 13, and Windows XP) for backup. Set backup parameters. Verify the configuration. Verify backup and restore. Revision: 1.4

Table of Contents
1 The Problem .................................................................................................................................3 2 The Challenge ..............................................................................................................................3 3 The Solution: Amanda .................................................................................................................3 3.1 Installation Prerequisites ......................................................................................................5 4 Installing the Amanda Backup Server .........................................................................................6 5 Installing the Amanda Clients ......................................................................................................7 5.1 Installing Amanda Client RPM on Iron (Fedora 13) ............................................................7 5.2 Installing Amanda Client RPM on Copper (SLES 11) ........................................................8 5.3 Installing Amanda Client on Uranium (Windows XP) ........................................................9 6 Configuring the Backup Server ...................................................................................................9 6.1 Configuring the Server .......................................................................................................10 6.2 Adding Client Iron (Fedora 13) ..........................................................................................11 6.3 Adding Client Copper (SLES 11) ......................................................................................11 6.4 Adding Client Uranium (Windows XP) .............................................................................12 7 Verification and Backup ............................................................................................................13 8 Recovery ....................................................................................................................................14 8.1 Recovery of Linux client (Copper) ....................................................................................14 8.2 Recovery of ZWC client (Uranium) ...................................................................................16 9 Conclusion .................................................................................................................................17 10 Request for Feedback ...............................................................................................................17 11 Glossary ...................................................................................................................................18

Page 2 of 18

1 The Problem
Today's businesses rarely run on just one operating system. Linux users and administrators often have strong preferences for one distribution over another, web designers might lean towards the Mac, and legacy software and hardware may require various UNIX operating systems. Yet, despite the complexity of modern business computing environments, a system administrator is expected to find a reliable backup solution. Many enterprises expect users to keep important files on networked resources, both for sharing and to back them up. Others expect to back up desktop machines and laptops. With the price of hard disk storage continuously falling, today it is common to have terabytes of storage and corresponding amounts of data that can be lost1. Furthermore, we live in a global and ecommerce economy, where businesses run around the clock and crucial business data is constantly changing. In this environment, it is more critical than ever to have a reliable backup system in place.

2 The Challenge
For our 15-minute challenge, we want to backup two Linux systems (each running a different Linux distribution) , and one Windows XP system. We use only freely available open source software. Our scenario is as follows: The user Sunil works with sensitive information. We need to make a backup of his home directory, /home/sunil, which resides on a Linux system called Iron, running Fedora 13. Our webmaster needs to backup the /srv/www/htdocs/ directory on the webserver, Copper, running SUSE Linux Enterprise Server 11 (SLES 11). Our manager works solely on a Windows XP system called Uranium, and keeps all of his work in a folder called C:\Data. Here is a summary of our configuration: Client Copper Iron Uranium Filesystem /srv/www/htdocs/ /home/sunil C:\Data SLES 11 Fedora 13 Windows XP OS Compression? Yes Yes Yes

The Compression? column refers to whether that client should compress the data rather than the server (or even the tape drive).

3 The Solution: Amanda


Amanda is open-source backup software that is flexible, secure and scalable in dynamic computing environments. Amanda can save you from expensive proprietary backup software and from those custom backup scripts that dont scale and have a propensity to break at the worst times. Dating back to 1991, Amanda has been used successfully in environments from one
1 "Data expands to fill the space available for storage" is a special case of Parkinson's Law which dates back decades.

Page 3 of 18

standalone machine to hundreds of clients. Amanda is so thoroughly documented, from community wikis to published system administration texts, that it might be hard to discern just how easy an Amanda backup can be. This article will show you how, in about 15 minutes, you can: 1. Install and configure the Amanda backup server. 2. Install and configure the three different clients for backup. 3. Set backup parameters. 4. Verify the configuration. 5. Perform a backup. 6. Recover some files from a backup. We will install and configure Amanda backup server software on a machine running Red Hat Enterprise Linux 5 named Quartz. The Amanda Server software manages the backup data, the backup schedule, and stores the backups on media. We will install and configure Amanda backup client software on Copper and on Iron. The Windows XP client, Uranium, will be backed up using Zmanda Windows Client Community Edition (ZWC).

Illustration 1: Backup Schematic

It is good practice to back up critical portions of the backup server as well as clients. We don't show a backup on the server. It is just another Linux client to Amanda. Adding a suitable backup on Quartz will be left as an exercise. Compression is available on amanda servers and clients. You may specify the compression tool on Unix clients and servers. The Zmanda Windows Client uses ZIP compression, which is compatible with pkzip, winzip and other classic Windows archival tools. Client side compression offers two advantages:
Page 4 of 18

Less data to send over the network, so faster backups. Because of Amanda's parallelism, you don't have the backup server compressing several dumps simultaneously, which relieves the backup server considerably.

On the other hand, compression on the client may use up resources (CPU and memory) on the client. Depending on the relative resources of the client and server, it may be optimal to compress on the server rather than the client.

3.1 Installation Prerequisites


There are two components to Amanda, the client and the server. Install one, the other or both as required. The basic Amanda setup consists of an Amanda server, the Amanda clients to be backed up, and the storage media on which the backup data will be stored, such as tape or hard disk. We can also use an intermediate storage area called a holding disk for caching the data. A holding disk provides these key benefits:

It allows data to be streamed to media at full speed, preventing tape buffer under-runs and shoe-shining of tapes. It can act as a hedge against media failure. Data is first backed-up to the holding disk, and then later spooled to media when it is available. It gives you dump parallelism. With a holding disk, Amanda can do more at the same time, speeding things up. It can build several dumps simultaneously on the holding disk while copying one to tape. Changing a tape doesn't mean stopping the backups.

It is a good practice to include a holding disk as a part of even a minimal setup. You may want to take a look at the Introduction to Amanda. This will give you some understanding of the advantages of using Amanda, the community around Amanda, and the resources available to you. Before we begin, please note the following prerequisites. Their installation, configuration and use are beyond the scope of this article. 1. tar 1.15 or later and xinetd are required for Unix clients, so they must be installed on Quartz, Iron and Copper. 2. Quartz will send out email reports of each backup run, so it must be able to send mail to the root user. Any mail transport agent (MTA) will do. 3. The systems should all be on the same network and available. 4. We will need general root access as well as remote root access through SSH to UNIX and Linux clients. Ensure that SSH is enabled, passed through the firewalls, and working. We will use configuration commands over SSH later. 5. Deal with firewall issues. Clients must allow TCP ports 10080 through 10083 inclusive from the backup server through their firewalls 6. Directories to be backed up must exist.

Page 5 of 18

You can get free Amanda binary and source RPM packages, and source tarballs from http://www.amanda.org/download.php. You can get the binary of Zmanda Windows Client (ZWC) Community Edition for free from http://www.zmanda.com/download-amanda.php. Your Linux distribution repositories may have amanda packages, but those may not be the most recent and may not contain some of the utility scripts we show here. We recommend the most recent version, so we will install those. Download as follows: 1. The Amanda backup server RPM package onto Quartz. 2. The Amanda client RPM onto Iron and Copper. On Iron, if there is no RPM for Fedora 13, get that for 12. 3. The ZWC client onto Uranium. Also note that this article assumes a fresh install of Amanda. If you have an existing Amanda installation, additional steps are needed to ensure the proper upgrade to the latest Amanda release (3.1.0 and later). While this article shows using Amanda 3.1.0, we recommend the latest versions1. The latest version of the Windows client may not agree exactly with the Linux server. Usually clients will work just fine with an Amanda server version of similar version number. For additional details about ZWC client installation please refer to the Amanda Wiki. The messages on your screen will be similar to what we show below. To conserve paper and bandwidth, we have omitted a lot of the installation output. Note: You can install Amanda on a host that had a previous installation of Amanda. In that event, you will see messages indicating that the user amandabackup already exists and that you should check certain properties. This is generally not a problem.

4 Installing the Amanda Backup Server


1. Log in as root on Quartz, the Red Hat Enterprise Linux 5 server. 2. Install the Amanda backup server RPM. As a part of the installation a user named amandabackup is created who belongs to the group disk. We use yum to check for and install dependencies.
[root@quartz ~]# yum --nogpgcheck install amanda-backup_server3.1.0-2.rhel5.i386.rpm Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * addons: updates.interworx.info * base: mirrors.adams.net * extras: mirrors.adams.net * updates: mirrors.easynews.com Setting up Install Process Examining amanda-backup_server-3.1.0-2.rhel5.i386.rpm: amandabackup_server-3.1.0-2.rhel5.i386
1 As of this writing, the latest is 3.1.0.

Page 6 of 18

Need enterprise level support for Amanda? Upgrade to Amanda Enterprise Edition: http://www.zmanda.com/amanda-enterpriseedition.html Jun 11 2010 16:15:23: === Amanda backup server installation complete. === Amanda installation log can be found in '/var/log/amanda/install.log' and errors (if any) in '/var/log/amanda/install.err'. Installed: amanda-backup_server.i386 0:3.1.0-2.rhel5 Complete! [root@quartz ~]#

3. As root set a password for user amandabackup on Quartz


[root@quartz]# passwd amandabackup Changing password for user amandabackup. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully.

4. Later, you may wish to back up Quartz or to recover files on Quartz. In fact later on we will recover some data on Quartz. To recover on a Linux client, you must first specify the tape device on the server to use. In each Linux clients we change the file /etc/amanda/amanda-client.conf. Change this line:
tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device

to this:
tapedev "file://data/amanda/vtape/DailySet1" # your tape device

5 Installing the Amanda Clients 5.1 Installing Amanda Client RPM on Iron (Fedora 13)
1. Log in as root on Iron. 2. Install the Amanda backup client RPM. We use yum to check for and install dependencies, in this case xinetd. As a part of the installation a user named amandabackup is created who belongs to the group disk.
[root@iron ~]# yum --nogpgcheck install amanda-backup_client-3.1.01.fc12.i686.rpm Loaded plugins: presto, refresh-packagekit Setting up Install Process Examining amanda-backup_client-3.1.0-1.fc12.i686.rpm: amandabackup_client-3.1.0-1.fc12.i686 Page 7 of 18

Installed: amanda-backup_client.i686 0:3.1.0-1.fc12 Dependency Installed: xinetd.i686 2:2.3.14-30.fc13 Complete! [root@iron ~]#

3. As root set password for user amandabackup on Iron


[root@iron]# passwd amandabackup Changing password for user amandabackup. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully.

4. To recover on a Linux client, you must first specify the tape device on the server to use. In each Linux clients we change the file /etc/amanda/amanda-client.conf. Change this line:
tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device

to this:
tapedev "file://data/amanda/vtape/DailySet1" # your tape device

5.2 Installing Amanda Client RPM on Copper (SLES 11)


1. Log in as the root user on Copper, your SUSE Linux Enterprise Server 11 client. 2. Get the client RPM. 3. Install the Amanda backup client RPM. As a part of the installation a user named amandabackup is created who belongs to the group disk.
copper:~ # rpm -ivh amanda-backup_client-3.1.0-2.sles11.i586.rpm Preparing... ########################################### [100%] Jun 17 2010 14:48:34: Preparing to install: Amanda Community Edition - version 3.1.0 Jun 17 2010 14:48:34: Checking for 'amandabackup' user... Jun 17 2010 14:48:34: Jun 17 2010 14:48:34: The 'amandabackup; user account has been successfully created. Jun 17 2010 14:48:34: Furthermore, the account has been automatically locked for you Jun 17 2010 14:48:34: for security purposes. Once a password for the 'amandabackup' Jun 17 2010 14:48:34: account has been set, the user can be unlocked by issuing Page 8 of 18

Need enterprise level support for Amanda? Upgrade to Amanda Enterprise Edition: http://www.zmanda.com/amanda-enterpriseedition.html Jun 17 2010 14:48:43: Setting ownership and permissions for '/var/lib/amanda/.profile' Jun 17 2010 14:48:44: === Amanda backup client installation complete. === Amanda installation log can be found in '/var/log/amanda/install.log' and errors (if any) in '/var/log/amanda/install.err'. copper:~ #

4. As root set password for user amandabackup on Copper


copper:~ # passwd amandabackup Changing password for amandabackup. New Password: Reenter New Password: Password changed.

5. To recover on a Linux client, you must first specify the tape device on the server to use. In each Linux clients we change the file /etc/amanda/amanda-client.conf. Change this line:
tapedev "tape:/dev/YOUR-TAPE-DEVICE-HERE" # your tape device

to this:
tapedev "file://data/amanda/vtape/DailySet1" # your tape device

5.3 Installing Amanda Client on Uranium (Windows XP)


1. Navigate to the directory where you downloaded the Amanda Client package. 2. Double click on the file, e.g.: ZWC-Community-3.1.beta-32bit.zip. Then click on extract all files. Click on OK, then on Next. 3. Click on the newly created directory, e.g.: ZWC-Community-3.1.beta-32bit. Double-click the setup.exe to install the Windows client.

6 Configuring the Backup Server


Amanda's quantum unit of backup is the disk list entry, or DLE. DLEs are entered into one or more configurations. We will build three DLEs, one for each machine we back up. A machine can have multiple DLEs, but DLEs do not span computers. We will build one configuration. By custom, Amanda examples use the configuration DailySet1. Should you ever need to edit the configuration, its files are usually found in /etc/amanda/DailySet1/. For example, later on we will add two dumptypes to our configuration so that we can use the Zmanda Windows Client.
Page 9 of 18

6.1 Configuring the Server


We will specify a number of parameters on the command line. There is more on these in the wiki and in the man page for amserverconfig. There are other options, but the defaults will do just fine for now. There is a brief description of the parameters we set initially in the Glossary, on page 18. We will back up all our clients to Quartz in the /data directory. Ensure that we are logged-in to Quartz as user root. 1. Create a directory for our vtapes, and set its ownership and permissions:
[root@quartz ~]# mkdir -p /data/amanda/vtape/DailySet1 [root@quartz ~]# chown amandabackup:disk /data/amanda/vtape/DailySet1 [root@quartz ~]# chmod -R 750 /data/amanda/vtape/DailySet1

2. Change to the amandabackup user:


[root@quartz ~]# su amandabackup

3. As amandabackup user, run amserverconfig to create a vtape configuration:


-sh-3.2$ amserverconfig DailySet1 --template harddisk --tapedev /data/amanda/vtape/DailySet1 --mailto root@localhost --dumpcycle 1week --runspercycle 5 --tapecycle 12 --runtapes 1 Logging to /var/log/amanda/amserverconfig.20100621131218.debug /etc/amanda/template.d directory created /var/lib/amanda/gnutar-lists directory exists /etc/amanda/DailySet1/advanced.conf created and updated curinfo and index directory created tapelist file created disklist file created Creating custom configuration using templates custom amanda.conf created creating vtape directory amlabel vtapes changer is reset /var/lib/amanda/example/xinetd.amandaserver contains the latest Amanda server daemon configuration. Please merge it to /etc/xinetd.d/amandaserver. /var/lib/amanda/.ssh/client_authorized_keys created. Please append to /var/lib/amanda/.ssh/authorized_keys file on Amanda clients DONE.

Note the creation of SSH keys, useful for backups over SSH. It is up to you to manually (and securely) add the public key to the client amandabackup user's authorized_keys file.

Page 10 of 18

6.2 Adding Client Iron (Fedora 13)


Use amaddclient to enable backups of client iron:
-sh-3.2$ amaddclient --config DailySet1 --client iron.example.com --diskdev /home/sunil --dumptype comp-user-tar Logging to /var/log/amanda/amaddclient.20100621133307.debug /etc/amanda/DailySet1/disklist updated updating /var/lib/amanda/.amandahosts on quartz.example.com Attempting to update /var/lib/amanda/.amandahosts on iron.example.com .amandahosts 100% 76 0.1KB/s 00:00 .amandahosts.tmp 100% 112 0.1KB/s 00:00 iron.example.com:/var/lib/amanda/.amandahosts updated successfully Creating amanda-client.conf for iron.example.com Creating /etc/amanda/DailySet1 on iron.example.com amanda-client.conf-iron.example.com 100% 380 0.4KB/s 00:00 Copy /var/lib/amanda/amanda-client.conf-iron.example.com to iron.example.com successfully File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration. Please merge it to /etc/xinetd.d/amandaclient.

6.3 Adding Client Copper (SLES 11)


Use amaddclient to enable backups of client copper:
-sh-3.2$ amaddclient --config DailySet1 --client copper.example.com --diskdev /srv/www/htdocs/ --dumptype comp-user-tar Logging to /var/log/amanda/amaddclient.20100622120516.debug /etc/amanda/DailySet1/disklist updated updating /var/lib/amanda/.amandahosts on quartz.example.com Attempting to update /var/lib/amanda/.amandahosts on copper.example.com .amandahosts 100% 76 0.1KB/s 00:00 .amandahosts.tmp 100% 112 0.1KB/s 00:00 copper.example.com:/var/lib/amanda/.amandahosts updated successfully Creating amanda-client.conf for copper.example.com Creating /etc/amanda/DailySet1 on copper.example.com amanda-client.conf-copper.example.com 100% 380 0.4KB/s 00:00 Copy /var/lib/amanda/amanda-client.conf-copper.example.com to copper.example.com successfully

Page 11 of 18

File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration. Please merge it to /etc/xinetd.d/amandaclient.

6.4 Adding Client Uranium (Windows XP)


Use amaddclient to enable backups of the Windows XP client (ZWC) Uranium: 1. Before running amaddclient, append the following dumptype definitions to the file /etc/amanda/template.d/dumptypes. These definitions are needed to backup ZWC clients.
define dumptype zwc-normal { global program "DUMP" } define dumptype zwc-compress { global compress client fast program "DUMP" }

2. Run amaddclient for Uranium. You will notice several error messages indicating that our user does not have SSH access to Uranium. Most of the time, this is probably a good idea. For now it means amaddclient cannot copy an xinetd configuration file and an Amanda client configuration file onto Uranium for us. Usually, the fallback is for us to copy them manually, as the error message indicates. However, Uranium is a Windows machine, and doesn't run xinetd. The Zmanda client handles the issues for us. So we can ignore the error.
-bash-3.00$ amaddclient --config DailySet1 --client uranium.zmanda.com --diskdev C:/Data --dumptype zwc-compress Logging to /var/log/amanda/amaddclient.20080813095400.debug /etc/amanda/DailySet1/disklist updated updating /var/lib/amanda/.amandahosts on quartz.zmanda.com /var/lib/amanda/.amandahosts contains uranium.zmanda.com root, file not updated Attempting to update /var/lib/amanda/.amandahosts on uranium.zmanda.com ssh: connect to host uranium.zmanda.com port 22: Connection refused WARNING: scp from uranium.zmanda.com not successful. Check uranium.zmanda.com :/var/lib/amanda/.amandahosts file. If entry 'quartz.zmanda.com amandabackup' is not present, append the entry to the file manually. Creating amanda-client.conf for uranium.zmanda.com Creating /etc/amanda/DailySet1 on uranium.zmanda.com ssh: connect to host uranium.zmanda.com port 22: Connection refused WARNING: Cannot create /etc/amanda/DailySet1 on uranium.zmanda.com Page 12 of 18

Please copy /var/lib/amanda/amanda-client.conf-uranium.zmanda.com to uranium.zmanda.com manually File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration. Please merge it to /etc/xinetd.d/amandaclient.

7 Verification and Backup


We will test the backup configuration for all three clients and then kick-off a backup run. Ensure that we are logged-in to Quartz as user amandabackup. 1. As amandabackup, run the amcheck command to test validity of the configuration and connectivity between client and server
-sh-3.2$ amcheck DailySet1 Amanda Tape Server Host Check ----------------------------slot 1: volume 'DailySet1-1' Will write to volume 'DailySet1-1' in slot 1. NOTE: skipping tape-writable test NOTE: host info dir /etc/amanda/DailySet1/curinfo/iron.example.com does not exist NOTE: it will be created on the next run. NOTE: index dir /etc/amanda/DailySet1/index/iron.example.com does not exist NOTE: it will be created on the next run. NOTE: host info dir /etc/amanda/DailySet1/curinfo/copper.example.com does not exist NOTE: it will be created on the next run. NOTE: index dir /etc/amanda/DailySet1/index/copper.example.com does not exist NOTE: it will be created on the next run. NOTE: host info dir /etc/amanda/DailySet1/curinfo/uranium.example.com does not exist NOTE: it will be created on the next run. NOTE: index dir /etc/amanda/DailySet1/index/uranium.example.com does not exist NOTE: it will be created on the next run. Server check took 2.118 seconds Amanda Backup Client Hosts Check -------------------------------Client check: 2 hosts checked in 7.400 seconds. (brought to you by Amanda 3.1.0)

0 problems found.

2. The amcheck command should not generate any errors. The NOTE messages we see here are normal for DLEs that have not yet been backed up. If we see the expected 0 problems found result, we can now initiate the first full backup:
Page 13 of 18

[amandabackup@quartz ~]$ amdump DailySet1

3. Once the backup run is complete, the root user should receive an e-mail with the backup summary on the Amanda server. 4. We can now create a cron job for user amandabackup that will execute amdump and initiate the backups automatically. Execute the crontab command to create the job:
[amandabackup@quartz ~]$ crontab e

and add this line to the file to run backups daily Monday through Friday at 1 AM:
0 1 * * 1-5 /usr/sbin/amdump DailySet1

8 Recovery
Finally, we will perform a recovery of some of the data we have backed-up. This is a crucial step always verify a backup system to confirm that you can recover data. The recovery procedure for windows client is different from that for a Linux client. ZWC Community Edition does not yet support direct restore on a client. Instead, first restore data on your Amanda server (or another client), and then copy it to the client.

8.1 Recovery of Linux client (Copper)


1. On the host Copper, as the user root, run amrecover to initiate the data recovery process. Here we recover to a temporary directory. Any empty directory will do.
copper:~/tmp/amanda # amrecover DailySet1 AMRECOVER Version 3.1.0. Contacting server on quartz.example.com ... 220 quartz AMANDA index server (3.1.0) ready. Setting restore date to today (2010-06-22) 200 Working date set to 2010-06-22. 200 Config set to DailySet1. 501 Host copper is not in your disklist. Trying host copper.example.com ... 200 Dump host set to copper.example.com. Use the setdisk command to choose dump disk to recover

2. The list of commands below will demonstrate a recovery of a set of different files and directories to the "/tmp" directory.
amrecover> listdisk 200- List of disk for host copper.example.com 201- /srv/www/htdocs/ 200 List of disk for host copper.example.com amrecover> setdisk /srv/www/htdocs/ 200 Disk set to /srv/www/htdocs/. amrecover> ls 2010-06-22-14-14-31 robots.txt 2010-06-22-14-14-31 index.html 2010-06-22-14-14-31 favicon.ico Page 14 of 18

2010-06-22-14-14-31 apache_pb22_ani.gif 2010-06-22-14-14-31 apache_pb22.png 2010-06-22-14-14-31 apache_pb22.gif 2010-06-22-14-14-31 apache_pb.png 2010-06-22-14-14-31 apache_pb.gif 2010-06-22-14-14-31 . amrecover> add * Added file /robots.txt Added file /index.html Added file /favicon.ico Added file /apache_pb22_ani.gif Added file /apache_pb22.png Added file /apache_pb22.gif Added file /apache_pb.png Added file /apache_pb.gif amrecover> extract Extracting files using tape drive file://data/amanda/vtape/DailySet1 on host quartz.example.com. The following tapes are needed: DailySet1-1 Extracting files using tape drive file://data/amanda/vtape/DailySet1 on host quartz.example.com. Load tape DailySet1-1 now Continue [?/Y/n/s/d]? Restoring files into directory /root/tmp/amanda All existing files in /root/tmp/amanda can be deleted Continue [?/Y/n]? y ./apache_pb.gif ./apache_pb.png ./apache_pb22.gif ./apache_pb22.png ./apache_pb22_ani.gif ./favicon.ico ./index.html ./robots.txt amrecover> exit 200 Good bye.

Note that in the listing in amrecover, the dates are those of the backup, not necessarily those of the underlying files. 3. We can now verify that the files have been recovered successfully by running tree, find, ls -R, or any other suitable command.
copper:~/tmp/amanda # ll -R total 40 drwxr-xr-x 2 root root 4096 2010-06-22 14:55 . Page 15 of 18

drwxr-xr-x -rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--rw-r--r--

3 1 1 1 1 1 1 1 1

root root root root root root root root root

root root root root root root root root root

4096 2205 2410 1502 2326 1385 302 44 26

2010-06-22 2005-12-14 2005-12-14 2005-12-14 2004-11-20 2004-11-20 2008-07-23 2004-11-20 2010-05-05

14:53 09:25 09:25 09:25 13:16 13:16 10:08 13:16 08:43

.. apache_pb22_ani.gif apache_pb22.gif apache_pb22.png apache_pb.gif apache_pb.png favicon.ico index.html robots.txt

8.2 Recovery of ZWC client (Uranium)


The procedure to recover backup of windows client Uranium is as follows. 1. Log in as root on quartz, the Amanda Server, and create a directory, where you will restore the data. Make user amandabackup the owner of the directory.
[root@quartz amanda]# mkdir /restore [root@quartz amanda]# chown amandabackup:disk /restore/

2. As user amandabackup confirm the type of backup that you want to restore using the command amadmin. In our case we will be restoring a full and an incremental backup, both dated dated 13 August 2008. Syntax for amadmin is amadmin <BackupSetName> find <hostname> <disk>
[root@quartz amanda]# su - amandabackup -sh-3.2$ amadmin DailySet1 find uranium date host disk lv tape or file file part stat 2010-06-22 14:14:31 uranium "C:/Data" 0 DailySet1-1 1 1/1 OK

3. Change directory to /restore


-sh-3.2$ cd /restore/

4. Use amfetchdump to extract the contents from full backup (2008-08-13 10:23:07).Syntax of the command is amfetchdump <BackupSetName> <client> <disk> <YYYYMMDDHHMMSS>
sh-3.2$ amfetchdump DailySet1 uranium "C:/Data" 20100622141431 1 volume(s) needed for restoration The following volumes are needed: DailySet1-1 Press enter when ready amfetchdump: 1: restoring split dumpfile: date 20100622141431 host uranium disk "C:/Data" part 1/UNKNOWN lev 0 comp N program pkzip

5. Now you can see the data set in /restore.


-sh-3.2$ ls uranium.C__Data.20100622141431.0

Page 16 of 18

-sh-3.2$ file uranium.C__Data.20100622141431.0 uranium.C__Data.20100622141431.0: Zip archive data, at least v2.0 to extract

6. You can test the file locally.


-sh-3.2$ unzip -t uranium.C__Data.20100622141431.0 Archive: uranium.C__Data.20100622141431.0 testing: ZWCBackupInfo error: invalid compressed data to inflate testing: ZWC-Community-3.1.beta-32bit.zip OK At least one error was detected in uranium.C__Data.20100622141431.0.

The error on ZWCBackupInfo is normal, and will not affect your ability to extract the payload. 7. Move the file to the Windows system where you want to restore and extract the data using Compressed Folders utility in Windows XP or programs such as Winzip or Pkzip. Or you can extract it locally with unzip.
[root@quartz restore]# unzip uranium.C__Data.20100622141431.0 Archive: uranium.C__Data.20100622141431.0 skipping: ZWCBackupInfo volume label inflating: ZWC-Community-3.1.beta-32bit.zip

Note the difference in the two recovery clients. amfetchddump recovers a complete dump as a zip file while amrecover extracts files from the storage medium. Use amfetchdump where you may have ownership or permissions issues. For example, we might use amfetchdump to recover our Windows machines because Windows and Linux have different permissions schemes. Note also that Amanda uses operating system utilities (tar, dump, zip, etc.) to create the dumps; this means you are not dependent on proprietary programs to recover your data. Note well the implications for security: with proper (or improper!) access permissions, anyone can recover data for any client on any other client.

9 Conclusion
As we have just seen, backing-up and restoring files with Amanda is incredibly easy. Setup is also very quick. For more information, there is a wealth of documentation and examples available on the Amanda Wiki. There is also a large community ready to respond to ideas and requests for help on the Amanda Forums. As you explore the features and flexibility of Amanda, you will find that there is much more power to be harnessed from building your backup and recovery solution around Amanda.

10 Request for Feedback


Did this paper help you in your configuration? What did we not cover well? What could we have done better? Please provide feedback on this paper to community@zmanda.com. Your feedback, however brief, is very much appreciated.
Page 17 of 18

11 Glossary
DLE: Disk List Entry, the quantum unit of Amanda backup. dumpcycle: The number of days in the backup cycle, whether you run backups on all of those days or not. Each DLE will be backed up in its entirety at least once during this period. Specify per DLE in amanda.conf. dumptype: A definition of a dump. It specifies whether the client or server will compress or encrypt the dump (and with which program), what exclusions to apply (e.g. excluding a package cache under /var), and other characteristics. holding disk: an intermediate storage area for caching backup data. Specify per DLE in amanda.conf. mailto: One or more email addresses to send reports to. Specify per DLE in amanda.conf. runspercycle: How many dumps per cycle. In our example (see Section 6, Configuring the Backup Server, on page 9), we have a dump cycle of a week, but only five runs per week. Later, we will set this up as a cron job to run Monday through Friday (see Section 7, Verification and Backup, on page 13). Specify per DLE in amanda.conf. runtapes: The maximum number of tapes per a single run. You can span tapes (use multiple tapes per run) with this parameter, but we are going to keep our calculations simple by ignoring that capability. Specify per DLE in amanda.conf. tapecycle: How many tapes we will have. With physical tapes, of course, a physical count is the maximum. With virtual tapes, we can change this count on the fly according to disk usage. We will run five dumps a week. With 12 tapes, we keep a week of old backups in reserve, and still have two spares. The reserve week ensures that we always have at least one full backup for each DLE on hand. Spares are more important for physical tapes, but it's good practice to have them even with virtual tapes. Specify per DLE in amanda.conf. tapedev: The actual backup device. Normally this is a tape drive, e.g. /dev/st0; in this case a directory we will build. Specify per DLE in amanda.conf. template: Specify the type of backup medium, in this case virtual tapes on a hard drive. Specify per DLE in amanda.conf.

Page 18 of 18

You might also like