On Fri, 2012-04-13 at 11:19 -0700, Marcus Pless wrote: > I don't know if it's documented online but here's something like > what I've done in the past (config name was SGVA): >
Thanks. I'm currently trying the proposed "patch", which is to simply comment out those debugging lines. So far, so good. It does appear to be trying to recover the desired file. Fingers crossed. If that fails, I'm sure I'll quickly be paying close attention to your wonderful reply. I made sure to include the the mailing list such that it can benefit others down the road. Again, thanks everyone so much for your rapid replies. If I get stuck, I'm sure I'll be back. Regards, > > To determine where on a tape a certain dumpfile is: > Look in ~amanda/logs/SGVA/log.[date].[N] where date is the > date that the > tape was written, and N is a serial number, for the > amdump/amflush > performed that day. N is usually 0. > > grep taper ~amanda/logs/SGVA/log.20060316.0 | less -N > > Once you find the filesystem you look for, the number will be > one > greater than the filenumber on the tape. If you fsf to the > index > minus two, you should be okay. I like using two for the extra > insurance. > > Be careful when restoring from a multiple tape set. The > numbers will > be far off. A second tape is used when you see something like > this: > > 307 START taper datestamp 20060316 label SGVA0024 tape 1 > > You will have to account for the index number (307), and the > INFO line > that follows it. Only SUCCESS lines indicate a file written to > tape. > > > To manually extract a file from an amanda tape: > 1) insert the tape > 2) fast forward to the position on the tape desired > $ mt -f /dev/nst0 fsf 13 > 3) extract the file > $ dd if=/dev/nst0 bs=32k skip=1 of=restored.file > > The format will either be a native dump format, or in a tar > format. > It will possibly be gzipped. > > additional notes > Following the above procedures I was able to manually extract > the > necessary files from tape. However, I was unable to read them > using > tar or restore. The recovered dump files also weren't > compressed or > gzip'd. I used 'file' for the name of the output file with > 'dd'. > > [mpless@sgva-serv1 58]# file file > file: AMANDA dump file, DATE 20060422 hostname.ucsd.edu /var/s > > So, it's an AMANDA dump file. What that means is that I still > needed > to use 'amrestore file' to convert (extract?) the file I > pulled from > the tape into something I could work with. This produced a > file named > 'hostname.ucsd.edu._var_spool_mail.20060422.2' which I was > able to > process using tar. > > [mpless@sgva-serv1 58]# file > hostname.ucsd.edu._var_spool_mail.20060422.2 > hostname.ucsd.edu._var_spool_mail.20060422.2: GNU tar archive > > > Things can get more complicated depending on the version of > amanda you're using, if you're splitting files, spanning tapes, > etc. More complicated in that the entries in the log file may > not line up quite as nicely, but they can still be used to get > close, if you have a lot of disk list entries. My daily backups > are usually 500+ disk list entries, so I need to get close on > the tape to do this manually. > > The 'bs' argument to 'dd' needs to match whatever blocksize > amanda used when it wrote the tape; I think the default for > amanda is 32k. If you're not sure where you are on the tape you > can do something like > > dd if=/dev/nst0 bs=32k count=1 > > to see the amanda header, which will include the name of the > host and filesystem. Compare this to the entries in the log > file to see if you're getting close. If that's not it you can > then do something like > > dd if=/dev/nst0 bs=32k fsf=1 > > to get to the start of the next file on tape, and then check the > amanda header using the above dd command. You can follow this in > the amanda log file so you'll know when you're getting close. > > If you're at the beginning of the file on tape (you haven't > read the amanda header you can use > > dd if=/dev/nst0 bs=32k skip=1 of=restored.file > > to extract that file, minus the amanda header. If you just read the > amanda header and that's the file you want you can use > > dd if=/dev/nst0 bs=32k of=restored.file > > (don't do the skip=1) > > > This is actually a lot easier than it sounds, once you're gone > through it a time or two. If nothing else it's a good experience > for when things have really hit the fan and you need to manually > recover your amanda logs from tape to bootstrap your way back up. > > Good luck! > > --Marcus > > > > On 04/13/2012 11:02:33 AM, Greg Copeland wrote: > > On Fri, 2012-04-13 at 10:48 -0700, Marcus Pless wrote: > > > > > Have you tried amfetchdump? In the near-worst case scenario > > > you can use the log file to help you locate the file on tape, > > > extract the file to disk using dd, and then manually process > > > things. > > > > > > > > > Is there documentation on doing this? Have a link? > > > > BTW, thanks for so quickly responding. > > -- Greg Copeland <[email protected]> Copeland Computer Consulting
