Section 4.4. Amanda Recovery


4.4. Amanda Recovery

amrecover and amrestore restore Amanda backups. amrecover restores files using an interface that allows browsing of the backup file index to a certain date and selecting files to restore. Of course, to use amrecover, you should enable indexing of backup files when you specify the dumptype in amanda.conf. After you select files, Amanda finds the required tape, looks for the backup image, decompresses the image if required, brings the image over the network to the client, and pipes it into the appropriate restore program with the arguments needed to extract the requested files. In case you have to restore your files from incremental backups, Amanda specifies the correct order of the tapes. For security, amrecover must run as root on the client, and you should list root as the remote user in .amandahosts on the Amanda server.

Full filesystem recovery should be done with amrestore, which retrieves whole filesystem images from tape.

amrecover can be done on any client including the Amanda server. amrestore can be done only on the Amanda server. You have to use amrestore when you don't have a backup index.

If your backup policy specifies backup of everything including the operating system, you can do bare-metal recoveries with Amanda. Here's the procedure:

  1. Replace the disk.

  2. Boot with LiveCD (for example, Knoppix).

  3. Format and partition the disk.

  4. Use amrestore on the Amanda server to restore everything to a new disk, including the operating system (you might need to restore incrementals as well).

  5. Create a boot loader on the new disk.

The Amanda tape format is simple so that in case of emergency, you can restore data without any Amanda tools. The first tape file is a volume label with the tape volume serial number and date it was written. It is in plain text. Each file after that contains one image using 32 KB blocks. The first block is an Amanda header with the client, area, and options used to create the image. As with the volume label, the header is plain text. The image follows, starting at the next tape block, until end of file.

Because the image header is text, it may be viewed with these commands:

# mt rewind # mt fsf NN # dd if=$TAPE bs=32k count=1

In addition to describing the image, the Amanda tape format contains text showing the commands needed to do a restore. Here's a typical entry for the /home2 filesystem on iron.zmanda.com. It is a level 1 dump done without compression using Solaris ufsdump:

AMANDA: FILE 20060418 copper.zmanda.com /home2 lev 1 comp N program /usr/sbin/ufsdump

To restore, position the tape at start of file and run:

# dd if=$TAPE bs=32k skip=1 | /usr/sbin/ufsrestore -f... -

To retrieve an image with standard Unix utilities if amrestore is not available, position the tape to the image, then use dd to read it:

# mt rewind # mt fsf NN # dd if=$TAPE bs=32k skip=1 of=dump_image

The skip=1 option tells dd to skip over the Amanda file header. Without the of= option, dd writes the image to standard output, which can be piped to a decompression program, if needed, and then to the client restore program.

If RAIT is used as the media, a shell script using the commands dd and mt must be used to restore data from the tapes without using Amanda commands. As with any backup system, you should test and retest your restore procedures so you know exactly what to do when disaster strikes.




Backup & Recovery
Backup & Recovery: Inexpensive Backup Solutions for Open Systems
ISBN: 0596102461
EAN: 2147483647
Year: 2006
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net