Sean’s Obsessions

Sean Walberg’s blog

Amanda Didn’t Index the Tape, Had to Recover

I’ve been using AMANDA to back up my systems for ages. After accidentally blowing away a file today, I had to recover. However, for some reason, amrecover told me that I didn’t have an index for that volume, meaning that it had no way of knowing what tape the file would be on.

Checking myself, indeed, there were no indices for that host, and after looking at the configuration, it was my mistake (why the heck is that the default, I ask?). The files are either dump or tar files with an AMANDA header, but I had no way of knowing what tape my files were on, or how to get the files out .

I finally found the AMANDA FAQ which explains the header and the way to get data off.

Basically, I go

# mt -f /dev/nst1 fsf 1
# dd if=/dev/nst1 bs=32k count=1

looking for the right dumplevel, host, and volume. I knew I needed a full (level 0) backup, since the file has been there for a while.

When I found the tape, I ran mt -f /dev/nst1 status to figure out the block number. Finally, I rewind the tape, and pass the output through restore:

# mt -f /dev/nst1 rewind
# mt -f /dev/nst1 fsf 9
# dd if=/dev/nst1 bs=32k skip=1 | gunzip | restore -if -

This puts me into an interactive restore, where I can view the virtual filesystem contained within the dump, then pick the files I want.

While I use the built in amverify to periodically test the backups, I never actually tried to do a restore from that host in particular. Hopefully, now that I have indices, I won’t have to do this again.


I’m trying something new here. Talk to me on Twitter with the button above, please.