amrecover | Browse and restore NON-AFS backups. Won't properly restore afs images. Use /pool1/restore to temporarily hold recovered items on bambi. Usage: "amrecover -C umatlas". You can also run this from a remote host - please see further details in the section about this command |
amtape | Example: "amtape umatlas eject 0" - eject drive 0 and return tape to library slot. |
amadmin | Find dumps, many other admin commands. Example: amadmin umatlas find linat08 |
amlabel | Example: "amlabel umatlas L09045 slot 3" - label tape in slot 3 for Amanda usage with label L09045. Give "-f" flag to overwrite existing Amanda label. There is a script to label an entire magazine of tapes with barcodes as scanned by the library in /etc/amanda/label-changer-barcode. |
amrmtape | Example: "amrmtape umatlas L09045" - remove tape L09045 and all backups on it from backup indexes. |
amflush | Example: "amflush umatlas" - flush dumps from holding disk to tape. Use if you have a backlog of holding disk backups due to tape being offline for some period of time. |
mtx | Not part of amanda. For manipulating tape changer, but always use amtape for changing tapes around so amanda doesn't get out of sync and need to re-inventory. Example: mtx -f /dev/scsi/changer/c11t500104F000B87A68d0 status |
mt | Not part of amanda. For manipulating tape drive. Example: mt -f /dev/rmt/2 rewind |
amrecover -C umatlasYou'll be brought into a command line interface which allows you to use conventional 'ls' and 'cd' commands to explore the tape index at any available point in time. The online help should get you going (type "?"), but here's a quick tutorial.
amrecover> listhost 200- List hosts for config umatlas 201- localhost.localdomain ... etc ... etc ... amrecover> sethost localhost.localdomain 200 Dump host set to localhost.localdomain. amrecover> listdisk 200- List of disk for host localhost.localdomain 201- /pool1/mysql-backup 201- /etc/mysql-zrm 201- /etc/amanda 201- / 201- /pool1/lustre-backup amrecover> setdisk /etc/mysql-zrm amrecover> history 200- Dump history for config "umatlas" host "localhost.localdomain" disk /etc/mysql-zrm 201- 2013-08-17-00-00-00 1 L09006:33 201- 2013-08-16-00-00-00 0 L09007:21 201- 2013-08-15-00-00-01 1 L09019:42 ... etc.... etc. amrecover> setdate 2013-08-07 amrecover> ls ...etc... 2013-08-07-00-00-01 mysql-zrm.conf 2013-08-07-00-00-01 mysql-zrm-reporter.conf ...etc. amrecover> add mysql-zrm.conf Added file /mysql-zrm.conf amrecover> extract Extracting files using tape drive sl500 on host localhost. The following tapes are needed: L09010 Extracting files using tape drive sl500 on host localhost. Load tape L09010 now Continue [?/Y/n/s/d]? Y Restoring files into directory /pool1/restore All existing files in /pool1/restore can be deleted Continue [?/Y/n]? Y ./mysql-zrm.conf amrecover> quitThat's it. Your file is in the working directory.
amrecover -C umatlas -s bambi.local -t bambi.localYou have to enable the access on bambi.local. Wildcards do not work here to enable access for our whole network. In file /etc/amanda/.amandahosts add a line like this:
linat02.local root amindexd amidxtapedAlso it will not work from an AFS server because they have modified installations that point to non-standard GNU tar that amrecover doesn't like.
amadmin umatlas find linat08 "afs:linat08.grid.umich.edu/vicepg/home..*" ... 2012-11-14 02:00:01 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09036 5 1/1 OK 2012-11-15 02:00:01 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09036 12 1/1 OK 2012-11-16 02:00:00 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09019 35 1/1 OK 2012-11-19 02:00:00 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09009 3 1/1 OK 2012-11-20 02:00:00 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09006 26 1/1 OK 2012-11-21 02:00:00 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09011 26 1/1 OK 2012-11-22 02:00:00 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 1 L09026 29 1/1 OK 2012-11-23 02:00:00 linat08.local "afs:linat08.grid.umich.edu/vicepg/home..*" 0 L09032 41 1/1 OKOnce we know which dumps we want to restore, amfetchdump can find and restore them. It will load tapes or use holding disk as needed. You will need both a level 0 dump and a level 1 dump from any date after that.
amfetchdump umatlas -p linat06.local "afs:linat06.grid.umich.edu/vicepe/home..*" 20150407000000 | volset restore - home.user home.user.dumpfile.0 (now it will go through volumes in the volset and restore the one specified) Done with home.otheruser Done with home.otheruser Restoring: home.user Done with home.user ... etc ...The datestamp is exactly the same as the ones listed by 'amadmin find'. Just take out the dashes and colons. Repeat for the incremental you would like to restore (if desired, not required if the full dump from whatever date is new enough for you). Next transport the dumps someplace with afs access and restore the dumps using vos restore. I often copy to one of the interactives since I can use a password (ci-1-12.local or 13,14). Note that they are reverse named...1-12 is umt3int03. You can give the restored volume any name that makes sense. In many cases you might want to restore it without overwriting the old volume and then mount it someplace so the user can recover files.
/usr/sbin/vos restore -server linat08.grid.umich.edu -partition /vicepg -name home.username.restored -file home.user.dumpfile.0If also have an incremental dump to include:
/usr/sbin/vos restore -server linat08.grid.umich.edu -partition /vicepg -name home.username.restored -overwrite incremental -file home.user.dumpfile.1...and so on through all incrementals you may have. OR...if your backup server has access to AFS (bambi does not) restore directly into afs. Get the AFS tokens allowing you to do 'vos restore' (admin). As noted above, if this is one of the incremental dumpfiles use an incremental vos restore.
amfetchdump umatlas -p linat06.local "afs:linat06.grid.umich.edu/vicepe/home..*" 20150407000000 | volset restore home.user - | vos restore -server linat08.grid.umich.edu -partition /vicepg -name home.user.restoredIf this is a restore of a home that was wiped out entirely, don't forget to make a replica again (do +1 to RW server host number):
/usr/sbin/vos addsite -server linat06.grid.umich.edu -partition /vicepe -id home.user /usr/sbin/vos release home.userFinally, you'll need to mount the volume someplace:
/usr/bin/fs mkmount /afs/.atlas.umich.edu/home/user home.user /usr/sbin/vos release root.cell
amfetchdump -p linat06.local afs:hardware 20120629020000 > restored.hardware.dumpfile (if server has AFS access, can pipe to | vos restore -server dest-server -partition dest-part -name dest-name)NOTE: You may need to use the 'cut_garbage' perl script on Bambi in /pool1/amholding/restore to get a dumpfile that is suitable for 'vos restore'. Just use it like:
amfetchdump -p linat06.local afs:hardware 20120629020000 | /pool1/amholding/restore/cut_garbage > restored.hardware.dumpfileIf restoring from two tapes (one full, one incremental) you need to use the -incremental flag to vos restore for the incremental dumpfile(s).
# fetchdump -p hostname 'afs:src-serv/src-part/src-pattrn' | volset restore - '*' afs:dest-server/dest-partThe restored volumes will have the names as follows 'src.volume' in the volumeset will become 'src.volume.r' on the dest-part partition.
amlabel umatlas L09010 slot 30If there is an error but you are sure this tape is causing the issue use "-f" to force it. Label tapes with barcode. You can list the changer inventory with mtx. In general, the tape in the first tape drive will be the tape causing the problems with reading the label (it loaded the tape, tried to read the label, and stopped on the error). This error possibly is indicating a failing tape? Watch for it again on L09010. Typically in our case I believe it indicates a tape labeled with previous version of amanda.
mtx -f /dev/scsi/changer/c11t500104F000B87A68d0 statushttp://wiki.zmanda.com/index.php/Taper_log_says:_taper:_critical_(fatal):_Can't_locate_auto/Amanda/Device/Device/swig_volume.al_in_@INC
#!/usr/bin/bash ./configure --with-bsdtcp-security --with-bsdudp-security --with-rsh-security --with-ssh-security --prefix=/usr --libexecdir=/usr --sysconfdir=/etc --with-group=sys --localstatedir=/var --with-debugging=/var/log/amanda --with-fqdn --with-config=umatlas --with-smbclient=/usr/bin/smbclient --with-gnuplot=/opt/csw/bin/gnuplot --with-star=/opt/csw/bin/star --with-gnutar=/opt/csw/bin/gtarNote that the programs in /opt/csw have to come from the sunfreeware.com archive. They are installed using a util called "pkg-get".
patch -p0 < amanda-afs-cornell-dflushvol.patch(patch and amanda-afs.tar.gz are attached to this document) The "amanda" package from our yum repository has been compiled with the right options for AFS backups (according to directions from amanda-afs distribution). Regardless of whether you are doing an AFS backup or not, you also need the "amanda-afs" package to get /usr/sbin/gtar-wrapper.pl installed. Short summary is you compile using the --with-gnutar=/path/to/gtar-wrapper.pl.
On the client
[root@c-16-40 umatlas]# yum --enablerepo=umatlas install amanda-backup_client [root@c-16-40 umatlas]#vi /etc/xinetd.d/amandaclient (modify the user)user = amanda
[root@c-16-40 umatlas]# systemctl restart xinetd [root@c-16-40 ~]#vi /var/lib/amanda/.amandahosts (adding the following line) bambi.local amanda amdump
Verify if it is running on client:
[root@c-16-40 ~]# netstat -anp|grep 10080
On the server (bambi.local)
Addling the following lines:
root@bambi /var/log/amanda/amandad# grep dc48-16-40 /etc/amanda/umatlas/disklist dc48-16-40.local /opt/bro medium-tarAdding the following line to allow the client to run amrecover from the localhost
root@bambi# grep dc48-16-40 /etc/amanda/.amandahosts dc48-16-40.local root amindexd amidxtaped
Verify if the server can connect to the client:
amanda@bambi ~$ amcheck umatlas -c dc48-16-40Amanda Backup Client Hosts Check -------------------------------- Client check: 1 host checked in 1.124 seconds. 0 problems found.
From the client, to recover from a recent copy
[root@c-16-40 umatlas]# amrecover -C umatlas -s bambi.local -t bambi.local amrecover> sethost umfs02 501 Host umfs02 is not in your disklist. Trying host umfs02.local ... 200 Dump host set to umfs02.local. amrecover> listdisk</p> 200- List of disk for host umfs02.local 201- /data08/backup 201- /data08/manage amrecover> setdisk /data08/backup 200 Disk set to /data08/backup. amrecover> ls 2018-12-07-00-00-00 umdist
su - amanda amanda@bambi ~$ amdump umatlas --from-client umfs02.local
su - amanda amanda@bambi ~$ amflush umatlas
Or to flush a specific host and disk
amanda@bambi ~$ amflush umatlas umfs02 /data08/backup
amanda@bambi ~$ amadmin umatlas find umfs02
Log file is /etc/amanda/umatlas/logs
after power back on to bambi, I had to do a few things to make it work again:
1) start the services (now it is enabled to auto start at boot)
svcadm enable amanda/tcp svcadm enable amanda/udp svcadm enable amandaidx/tcp root@bambi /etc/amanda/umatlas/logs# svcs |grep amanda online Feb_11 svc:/network/amanda/tcp:default online Feb_11 svc:/network/amanda/udp:default online Feb_11 svc:/network/amandaidx/tcp:default2) the tape was not working , due to a stuck tape in one of the driver. amtape won't recoginize the volume.
I used the mtx command to unload the volume from the driver (amtape eject 0 would not work, because it did not see a volume loaded in the driver)
mtx -f /dev/scsi/changer/c7t500104F000B87A69d0 unload 31 0
afterwards,
amtape umatlas inventory
show the correct information.
In the meanwhile, also run
amtape umatlas show
to scan all the slots in the changer.
3) verify the connections to server and client
amcheck umaltas -s amcheck umatlas -c [host]
4) force to run a dump on all the clients (since the last backup was about 2 months ago due to power off)
amdump umaltasThis will collect all the dumped files from the clients, and write to the /pool1/amholding directory. Amanda will decide when to flush (amflush) the contents in the holding disk to the tape library. Note. a full dump(backup) of all clients has about 1.7TB, so it takes a few hours..by default, amanda starts the amdump at middle night, but it won't run if there is already a amdump process running.
-- BenMeekhof - 10 Jul 2007
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
patch | amanda-afs-cornell-dflushvol.patch | manage | 4 K | 14 Aug 2007 - 19:16 | BenMeekhof | patch for amanda-afs (needed to compile) |
gz | amanda-afs.tar.gz | manage | 42 K | 14 Aug 2007 - 19:15 | BenMeekhof | AFS tools for Amanda |