dds2tar 2.5.2 review

Download
by rbytes.net on

dds2tar is a tool makes use of the fast seek command of DAT devices. Files from a selected file archive can be extracted within on

License: GPL (GNU General Public License)
File size: 66K
Developer: Christof Meerwald
0 stars award from rbytes.net

dds2tar is a tool makes use of the fast seek command of DAT devices.

Files from a selected file archive can be extracted within one minute.

This tool was originally written for Linux SCSI tape archives. All device dependent code is separated. It should be easy, to change this for your machine type.

The only problem should be the ioctls for MTIOCTOP,(MTSEEK,arg) and MTIOCPOS.

To extract a file from a tape, you have to know the location of the file. A tar archive is a sequence of tar records, 512 byte each. The blocksize (tar -b #) selects the number of tar records inside each block of the tape. (HP is calling the blocks of the tape records also.)

The location of a file is a tuple of the block number and the number of the record where the header of the file can be found inside the block.

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

Tar is writing some record information to stdout, when you select the options -R and -v. To use this information as a location table, you have to know the block number of the first block and the blocksize of the archive. If it's the first archive of the tape and the blocksize is the default of 20, you can use the verbose lines of tar as a location table. (Additional lines with warnings can be included). Otherwise you have to patch tar to retrieve the
location information. If you don't want to patch tar, feel free to insert the output of 'mt-dds tell' at the top of the verbose output of tar.

If you have applied the patch file 'tar-1.12.patch' to GNU tar, you can use the verbose output of the tar command (tar -c -v --record-file F) instead of the index file generated with the dds2index command above.

(If you patch tar-1.12, you are able to write the record-information to a file while getting the errors on screen. The patch 'tar-1.12.patch' adds the option '--record-file F'. Additionally a small bug in the source file 'create.c' of tar is fixed. I have moved one line to correct the verbose output of the record numbers. While creating the archive, you can store the current time at the label record. A bug fix to write this date to the verbose output is also done in the source file 'list.c'.)

! The patch tar-1.12.patch moves one line inside the source file 'create.c'
! and adds some lines for the ability to direct the verbose output to a file.
! Two extra lines are printed to the terminal in some cases to get to current
! tape position at the start and the blocksize.
! Nothing else is done. There should be no extra risk for your data.
! The tar will stay fully compatible to the original version.
! The patch is also convenient for other operating systems.

Lines of the index file stating with '#' are ignored. So you can insert some comments. This distribution includes some examples of index files. Look for files 'index-of-*'

Once you have the table, you can get the files very quickly. Lets suppose, you want to extract everything of the glibc, you have to invoke the following command:

dds2tar -t my-archive-table '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 restoring to your disk.

This will also work, if the files are not a continuous 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.

dds2tar 2.5.2 search tags