
    dds2tar  Digital-Data-Storage Extract Tool

             This tool makes use of the fast seek command of DAT devices.
             Files from a selected file archive can be extracted withing
             one minute.

             This tool is written for Linux Scsi tape archives.
             It schould be easy, to change this for your machine.
             The only problem should be the ioctls for
                MTIOCTOP,(MTSEEK,arg) and MTIOCPOS.
             Please send the changes to me, so I can distribute them.

             J"org Weule                     weule@cs.uni-duesseldorf.de
                                             Fon: +49 211 751409

             This software is available at

                         ftp.uni-duesseldorf.de:/pub/unix/apollo

             ( This is my personal directory, I started writing PD-software
               on Apollo-Computers, but they are dieing now :-( . Now you
               will find some other stuff there.)

----------------------------------------------------------------------------

                              LICENCE

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published
    by the Free Software Foundation; either version 1, or (at your option) 
    any	later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

----------------------------------------------------------------------------


To extract a file from a tape, you have to know the location of the file.
The first step will be to extract a table with block and record information
of all files in one archive. If the archive is the 10'th file of the tape,
you will get the table by:

             mt asf 10
             dds2index -t my-archive-table -f /dev/nst0

If you have a copy of the verbose output of the tar command (tar -Rvc)
you can use this file instead of the index file generated with the
command above. If you want to use that tar output as an index file,
the archive must be the first file of the archive or you have to record
archive location with

             mt asf 10
             mt-dds -f /dev/nst0 -b 20 tell > loc-file

Note, that you have to know the block size, the default is 20.

Once you have the table, you can get the files very quickly. Lets suppose,
you want to extract erverything of the glibc, you have to invoke one
of the folowing commands:

             dds2tar -t my-archive-table -p glibc | tar -f - -xvv
             dds2tar -R tar-index -e loc-file -p glibc | tar -f - -xvv

dds2tar will search in the archive table for the blocks to read, and 
extracts the records with the selected files. These records together
are giving a valid tar archive, to use tar for restroing to your disk.
This will also work, if the files are not a continous area of the tape.
dds2tar is skipping over the gaps very quickly with a seek command.
If you want to extract exactly one file, use -x instead of -p.
If you want to extract all files, witch named include a pattern,
use -g instead of -p or -x.
A list of files is valid to search for. 

With the option -z, you can force the index file to be in compressed mode.
Compressed archive files are not supported.
If you  don't use the option -t, stdin or stdout are used in this case.
The default device is /dev/nst0, witch can be overwritten by the TAPE variable
and the option -f.

If you want to get familar with the command, use 

             # skipping to some file
             mt rewind
             mt fsf 20

             # creating the table of the archive
             dds2index -t my-archive-table 

             # extract all files with the substring glibc in there names
             # and use tar to check the output of dds2tar.
             dds2tar -t my-archive-table -g glibc | tar -f - -tvv
             # See waths goning on ...                  ^^^^ ^^

or use

             # skipping to some file
             mt rewind
             mt fsf 20

             # creating the table of the archive
             mt-dds tell | tee table
             tar -vtR >> table

             # extract all files with the substring glibc in there names
             # and use tar to check the output of dds2tar.
             dds2tar -R table -e table -g glibc | tar -f - -tvv
             # See waths goning on ...                ^^^^ ^^
             #   and don't write to the disk.


to see whats going on. In any case, dds2tar is reading your tape,
so don't worry. Only the file specified by -t is written by this example.

NOTE:
To make extraction easier, dds2tar will also extract the directories
for the selected files. So you will also get the full directory hierarchie.

If you are using the same file by -R and -e, you can not use the option -z,
since compression of the location file is not supported.

The owners of HP-DAT devices will find the actions comp-on, comp-off and
comp-query (dds-compression-mode) of mt-dds convenient to chage the compression
mode of the device. Turning off the compression will speed up storing
'gzip'ed files.

WARNING:
If we seek to the first block of a file, it can happen, that we are
going to the position before the filemark. The program is closing and opening
the file in that case to step over the filemark. Don't use /dev/st0 in that
case, use /dev/nst0.

THANKS:
Thanks to Andreas (Andreas_Bagge@h2.maus.de), who has send me a new manual
page, witch gave me the ideas how to split dds2tar-1.1.3 into peaces.
His page was also the starting point for the aproved man-page added to this
version.

Last change 3.9.94 by J"org Weule


