1. Knowledge Base
  2. Restore Operations

How to Recover From an Amanda Archive File Using System Tools From Command Line (Legacy Tapes)?

This article explains recovering from an Amanda Archive File using system tools from command line (Legacy Tapes)

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
  3. 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=l

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= bs=32k skip=1 | /usr/lib/amanda/application/amgtar restore [./file-to-restore]+

4. 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 the 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=l | /usr/lib/amanda/application/amgtar restore ./init.d ./rc.d/init. ./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 -