Amanda-Users

Re: How to examine a tape?

2004-04-22 12:07:35
Subject: Re: How to examine a tape?
From: <brad AT superconnect DOT net>
To: <amanda-users AT amanda DOT org>
Date: Thu, 22 Apr 2004 11:01:26 -0500
Essentially, you just dd the first 4k or so from each "tape file" into a
uniquely-named file, then skip to the next "tape file" with mt(1).

I've had good luck with something like the following (sorry, don't have
source handy right here):
----- 8< cut here >8 -----
#!/bin/YOUR_SHELL_HERE
I=1
SKIP=0
$TAPEDEV=/dev/YOUR_NO-REWIND_DEVICE

# optional but sane
mt -f $TAPEDEV rewind

while true
do

    # dump 4k from current tape file
    dd if=$TAPEDEV of=/tmp/tapefile.$I bs=4k skip=$SKIP

    # skip to next tape file
    mt -f $TAPEDEV fsf
done
----- 8< cut here >8 -----

You probably want to figure out how to terminate the loop for your own
setup. I remember examining exit status from the mt(1) fsf command to figure
out end-of-tape, but I also managed to Ctrl-C out when the console was all
errors.

For Amanda tapes, the odd-numbered /tmp/tapefile.N files should be the tape
labels, the even-numbered ones should be the first 4k from the tar/dump
archives. I think the archive excerpts are pretty obvious, and amanda tape
labels have plenty of ASCII data to ponder.
--
Brad Morrison, brad AT neosoft DOT com
"Press to test."
(click)
"Release to detonate."


<Prev in Thread] Current Thread [Next in Thread>