How to recover from an Amanda archive file using system tools from command line

This article is for Amanda Enterprise (AE) 

  1. Find the backup archive on disk or tape that you want to extract data from.  Backup archives on disk are located in the location specified on the Backup|where page in a directory named after the backup set.
  2. Create a temporary directory with sufficient space for the restore and change to this directory:
# mkdir /tmp/restore
# cd /tmp/restore
  1. Each backup archive begins with an Amanda header containing information about the archive.  Use the dd command to view the system recovery command at the end of the header.
    Example of reading the header from a backup archive disk:
# dd if=/var/lib/amanda/vtapes/ptest2/slot346/00001.rhel6-server-64._etc.0 bs=32k count=1

Example of reading the header from a backup archive on tape:

# dd if=/dev/nst0 bs=32k count=1

You may need to scroll back up in your terminal to see the tail end of the output which will contain a system restore command such as:

To restore, position tape at start of file and run:
    dd if=<tape> bs=32k skip=1 | /usr/lib/amanda/application/amgtar restore [./file-to-restore]+
  1. Extract desired files and/or directories from this archive using the restore command given at the end of the archive header.  Run the command as the root user for restoring files with original ownership and permissions.  If using tape, you must position the tape back to the beginning of the tape file for the archive you want to extract.  Please make sure to run the restore command in a temporary directory as existing data may be overwritten and erased by restore process and data!

Example of extracting directories ./init.d and ./rc.d/init.d from a Linux backup of the /etc directory:

# dd if=/var/lib/amanda/vtapes/ptest2/slot346/00001.rhel6-server-64._etc.0 bs=32k skip=1 | /usr/lib/amanda/application/amgtar restore ./init.d ./rc.d/init.d
./rc.d/init.d/
./init.d
./rc.d/init.d/auditd
./rc.d/init.d/cgconfig
./rc.d/init.d/cgred
./rc.d/init.d/crond
./rc.d/init.d/functions
./rc.d/init.d/halt
./rc.d/init.d/ip6tables
./rc.d/init.d/iptables
./rc.d/init.d/iscsi
./rc.d/init.d/iscsid
./rc.d/init.d/killall
./rc.d/init.d/lvm2-monitor
./rc.d/init.d/messagebus
./rc.d/init.d/netconsole
./rc.d/init.d/netfs
./rc.d/init.d/network
./rc.d/init.d/nfs
./rc.d/init.d/nfslock
./rc.d/init.d/postfix
./rc.d/init.d/rdisc
./rc.d/init.d/restorecond
./rc.d/init.d/rhnsd
./rc.d/init.d/rpcbind
./rc.d/init.d/rpcgssd
./rc.d/init.d/rpcidmapd
./rc.d/init.d/rpcsvcgssd
./rc.d/init.d/rsyslog
./rc.d/init.d/sandbox
./rc.d/init.d/saslauthd
./rc.d/init.d/single
./rc.d/init.d/sshd
./rc.d/init.d/stinit
./rc.d/init.d/udev-post
./rc.d/init.d/vmware-tools
./rc.d/init.d/xinetd
./rc.d/init.d/zmc_aee
5954+0 records in
5954+0 records out
195100672 bytes (195 MB) copied, 0.636116 seconds, 307 MB/s
/bin/gtar: Read 8192 bytes from -

Powered by BetterDocs

Leave a Reply