4.4. Amanda Recoveryamrecover 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:
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. |