On Wed, Mar 6, 2013 at 3:54 PM, Torfinn Ingolfsen <tingox at gmail.com> wrote:
On Wed, Mar 6, 2013 at 3:09 PM, Steve Merrony
<steve at stephenmerrony.co.uk> wrote:
What is the current best practice for creating an
image of a SCSI tape in
such a way that it can later be used to reliably make a replica of that
tape?
Are there any reason why you don't use dd or tar?
That would not work because the record information would be lost, and
the requirement was to make a replica of the tape (in addition 'dd'
will only read until the first EOF mark and then stop.)
I have been using a piece of software I wrote years ago which does
essentially what the previously mentioned 'tcopy' does, but in
addition it can write to files. It's a very simple tool I'm sure many
others have also written, what it does boils down to the following:
while (not eof)
{
record_size = read (tape deviice. record)
write (file, record_size, 4) // writes a 4-byte record with the record size
if (record_size > 0)
{
write (file, record, record_size) // write record
}
}
The disk file will then consist of 'records' prepended with a 4-byte
value with the record size. End-of-file marks on the tape (between
files) will be indicated with a record size of zero. At the end of the
tape, write 2 ore more zero-size records (ANSI tapes often used 2 or 3
EOF marks to indicate e-o-t or e-o-v).
To generate a new tape from the file just write a tool to understand
this simple format and write back record-by-record with size as
indicated in the file.
-Tor