add a config file git-buildpackage
[debian/dds2tar] / README
1
2     dds2tar  Digital-Data-Storage Extract Tool for LINUX and HP-UX
3
4              This tool makes use of the fast seek command of DAT devices.
5              Files from a selected file archive can be extracted within
6              one minute.
7
8              This tool was originally written for Linux SCSI tape archives.
9              All device dependent code is separated.
10              It should be easy, to change this for your machine type.
11              The only problem should be the ioctls for
12                 MTIOCTOP,(MTSEEK,arg) and MTIOCPOS.
13
14              Les.Grant@mitsuibabcock.co.uk send me a patch to make it
15              working under HP-UX, thanks.
16
17              Other patches epsecially for Solaris are welcome.
18
19              J"org Weule                     weule@cs.uni-duesseldorf.de
20                                              Fon: +49 211 751409
21
22              This software is available at
23
24                          ftp.uni-duesseldorf.de:/pub/unix/apollo
25
26              ( This is my personal directory, I started writing PD-software
27                on Apollo-Computers, but they are dying now :-( . Now you
28                will find some other stuff there.)
29
30 ----------------------------------------------------------------------------
31
32                               LICENSE
33
34     This program is free software; you can redistribute it and/or modify
35     it under the terms of the GNU General Public License as published
36     by the Free Software Foundation; either version 1, or (at your option) 
37     any later version.
38
39     This program is distributed in the hope that it will be useful,
40     but WITHOUT ANY WARRANTY; without even the implied warranty of
41     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
42     GNU General Public License for more details.
43
44     You should have received a copy of the GNU General Public License
45     along with this program; if not, write to the Free Software
46     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
47
48 ----------------------------------------------------------------------------
49
50                               DESCRIPTION
51
52 To extract a file from a tape, you have to know the location of the file.
53 A tar archive is a sequence of tar records, 512 byte each. The blocksize
54 (tar -b #) selects the number of tar records inside each block of the tape.
55 (HP is calling the blocks of the tape records also.)
56
57 The location of a file is a tuple of the block number and the number of the
58 record where the header of the file can be found inside the block.
59
60 The first step will be to extract a table with block and record information
61 of all files in one archive. If the archive is the 10'th file of the tape,
62 you will get the table by:
63
64              mt asf 10
65              dds2index -t my-archive-table -f /dev/nst0
66
67 Tar is writing some record information to stdout, when you select the options
68 -R and -v. To use this information as a location table, you have to know the
69 block number of the first block and the blocksize of the archive. If it's the
70 first archive of the tape and the blocksize is the default of 20, you can
71 use the verbose lines of tar as a location table. (Additional lines with
72 warnings can be included). Otherwise you have to patch tar to retrieve the
73 location information. If you don't want to patch tar, feel free to insert
74 the output of 'mt-dds tell' at the top of the verbose output of tar.
75
76 If you have applied the patch file 'tar-1.12.patch' to GNU tar, you can use 
77 the verbose output of the tar command (tar -c -v --record-file F) instead of the
78 index file generated with the dds2index command above.
79
80 (If you patch tar-1.12, you are able to write the record-information
81  to a file while getting the errors on screen. The patch 'tar-1.12.patch'
82  adds the option '--record-file F'. Additionally a small bug in the source file
83  'create.c' of tar is fixed. I have moved one line to correct the verbose output
84  of the record numbers. While creating the archive, you can store the current
85  time at the label record. A bug fix to write this date to the verbose output
86  is also done in the source file 'list.c'.)
87
88  !  The patch tar-1.12.patch moves one line inside the source file 'create.c'
89  !  and adds some lines for the ability to direct the verbose output to a file.
90  !  Two extra lines are printed to the terminal in some cases to get to current
91  !  tape position at the start and the blocksize.
92  !  Nothing else is done. There should be no extra risk for your data.
93  !  The tar will stay fully compatible to the original version.
94  !  The patch is also convenient for other operating systems.
95
96 Lines of the index file stating with '#' are ignored. So you can insert
97 some comments. This distribution includes some examples of index files.
98 Look for files 'index-of-*'
99
100 Once you have the table, you can get the files very quickly. Lets suppose,
101 you want to extract everything of the glibc, you have to invoke
102 the following command:
103
104              dds2tar -t my-archive-table 'glibc*' | tar -f - -xvv
105
106 dds2tar will search in the archive table for the blocks to read, and 
107 extracts the records with the selected files. These records together
108 are giving a valid tar archive, to use tar for restoring to your disk.
109 This will also work, if the files are not a continuous area of the tape.
110 dds2tar is skipping over the gaps very quickly with a seek command.
111 If you want to extract exactly one file, use -x instead of -p.
112 If you want to extract all files, witch named include a pattern,
113 use -g instead of -p or -x.
114 A list of files is valid to search for. 
115
116 With the option -z, you can force the index file to be in compressed mode.
117 Compressed archive files are not supported.
118 If you  don't use the option -t, stdin or stdout are used in this case.
119 The default device is /dev/nst0, witch can be overwritten by the TAPE variable
120 and the option -f.
121
122 If you want to get familiar with the command, use 
123
124              # skipping to some file
125              mt rewind
126              mt fsf 20
127
128              # creating the table of the archive
129              dds2index -t my-archive-table 
130
131              # The following line is an alternative way to create the index.
132              # You have to patch tar to make the option --record-file
133              # available.
134              # tar -t --record-file my-archive-table
135
136              # extract all files with the substring glibc in there names
137              # and use tar to check the output of dds2tar.
138              dds2tar -t my-archive-table 'glibc*' | tar -f - -tvv
139              # See what's going on ...                  ^^^^ ^^
140
141 to see what's going on. In any case, dds2tar is reading your tape,
142 so don't worry. Only the file specified by -t is written by this example.
143
144 NOTE:
145 To make extraction easier, dds2tar will also extract the directories
146 for the selected files. So you will also get the full directory hierarchy.
147
148 The owners of HP-DAT devices will find the actions comp-on, comp-off and
149 comp-query (dds-compression-mode) of mt-dds convenient to change the compression
150 mode of the device. Turning off the compression will speed up storing
151 'gzip'ed files.
152
153 WARNING:
154 If we seek to the first block of a file, it can happen, that we are
155 going to the position before the filemark. The program is closing and opening
156 the file in that case to step over the filemark. Don't use /dev/st0 in that
157 case, use /dev/nst0.
158
159 THANKS:
160 Thanks to Andreas (Andreas_Bagge@h2.maus.de), who has send me a new manual
161 page, witch gave me the ideas how to split dds2tar-1.1.3 into peaces.
162 His page was also the starting point for the approved man-page added to this
163 version.
164
165 Thanks also to Chris Hanson (cph@martigny.ai.mit.edu) for his bug bix.
166
167 Last change 2.2.95 by J"org Weule
168
169 ----------------------------------------------------------------------------
170
171                               INSTALLATION
172
173 1. Change the "Makefile" to reflect the buffersize of the kernel.
174    Otherwise uncomment the definition of BUFFER.
175
176 2. type "make install".
177
178 3. patch tar-1.12 if you like.
179