1 .TH dds2tar 1L 2.3 \" -*- nroff -*-
3 dds2tar \- tool for fast tape access
17 uses an index to find the files with record seek (a fast
18 operation of DAT devices).
19 Since the file structure of the tape archives is
20 used to extract the files, the archive has to be created by
22 compressed only by (the transparent
23 signal processor of) the device.
24 So you can step through the archive
25 very quickly and extract files.
26 The index may be created using
30 and is normally stored as a file on your hard disk.
32 A tar archive is a sequence of blocks (e.g. 10240 bytes by default),
33 each containing the same number (20 by default) of records, 512 byte each.
35 reads the tape and writes the tar records of the
36 specified files (that means the header record and the data records of each
41 output to the stdin of
43 to restore the files to your disk.
47 Before a file is extracted,
48 the records of parent directories of the file are also written to stdout.
50 The index of the archive should contain enough information
51 to compute the number of the block containing the header of each selected
54 will give such a table,
56 e.g. will not (only record numbers are listed).
59 is available, adding the option
61 Alternatively there are some tricks to get the missing
64 The strings are regular expressions to select the files.
65 The matching algorithm is the one from GNU tar. If the option
67 is given, the matched file names are printed to stdout (You may not pipe
68 this list of pathnames to tar!).
72 which may be overridden with the environment variable
74 which in turn may be overridden with the
76 option. The device must be a SCSI tape device.
79 Device of the tape archive. Must be a SCSI tape device.
82 Specifies the index file (default is stdin).
85 Set the number of the first tape block of the archive. This option is
86 useful only if the index file contains the verbose output of
88 Any information about the first block
89 inside the index file will be overridden by this option.
90 If no information is available, the archive has to be the first file of
91 the tape. If you have positioned your tape at the first block of the archive,
94 .B dds2tar `mt-dds` -t index ... | tar -f - ...
96 to complete the information of the output of
102 Set the blocksize of the archive (tar -b #). This option is
103 useful only if the index file contains the verbose output of tar (or if
104 you have problems with the size of the internal buffer of dds2tar).
105 Any information about the blocksize
106 inside the index file will be overridden by this option.
107 If no information is available, the default blocksize of tar is used.
110 The index file should be read and stored in compressed mode.
111 .SH OPTIONS you didn't really need
113 .B --z, --no-compress
114 Don't filter the archive file through gzip.
117 Don't extract the parent directories of the selected objects from tape.
119 Write only the first selected file to stdout. This is useful if you want to
120 read a file or extract an archive which is part of the current archive.
126 Print a hash sign for each MB.
129 Print only the Version Number to stderr.
132 Don't access the tape but print the file names to stdout.
133 You may not pipe this list of pathnames into tar.
136 The stdout is closed and opened by a pipe to the command
138 You may find this option convenient, I like to pipe the output to tar
143 from the default tape /dev/tape
144 and storing it in file archive.idx:
146 dds2index -t archive.idx
148 Alternatively you can use a patched version of tar to create an index file.
149 With the patch you can direct the errors and warning to stdout and the
150 index information including information about
151 the blocksize and the number of the
152 first block to a file:
154 tar -t --record-file archive.idx
156 If the archive is the first file of the tape and the blocksize is the default
157 of 20, you can use the verbose output of tar (-Rv) as an index file.
159 tar -t -v -R | tee archive.idx
161 If the archive is not the first file of the tape, you can store all the
162 necessary information inside the index file with the use of
171 mt-dds tell > archive.idx
172 tar -tvR >>archive.idx
178 to extract the gnu library
179 (all files containing the string "glibc" in filename)
180 from the default tape /dev/tape,
181 using the previously stored index file archive.idx:
183 dds2tar -t archive.idx '*glibc*' | tar xvvf -
186 To see in advance what would happen in the previous command
187 without actually writing anything to your disk,
190 dds2tar -t archive.idx '*glibc*' | tar tvvf -
192 Example of checking the matches. You may try:
194 dds2tar -t archive.idx -l '*glibc*'
196 \"---------------------------------------------------------------------------
197 \"-----------------------
198 .SH BACKGROUND INFORMATION
199 .\"-----------------------
202 A tape device handles all I/O (read, write, seek) in units of
204 The bigger a tape record, the more effective usually is
205 the access (and the less gaps are on QIC-tapes).
206 However, normally a program will only read or write complete tape records.
208 Normal tape drives allow to seek only relative to the current
209 position. However, some newer SCSI-2 tapes, i.e. DAT,
210 conforming to the DDS standard,
211 keep track of the absolute position on the tape by inserting the
212 tape record number inside each track.
213 This number can be read while
214 the fast seek is performed.
218 program uses a slightly different terminology.
221 what normally is called
223 In the following sections we use the tar terminology
231 with a fixed length of 512 bytes. Every file, directory or soft link
232 will occupy at least one tar record of information about
233 pathname, permission information and so on called header record.
234 The data of each file is stored in additional tar records directly after
235 the header record of that file.
239 of every header record in the archive with its -R option.
240 tar counts the records continuously,
243 (if invoked as tar -tR) or with
245 (if invoked as tar -cR).
247 tar handles multiple records as a
249 mainly to make the access of tapes (or disks) more efficient (and save
250 tape space of QIC-tapes).
251 tar only writes and reads full blocks to or from an archive.
252 The -b option of tar controls, how many records are in
253 one block. The default number of records per block is
255 This number is usually called the
256 .IR "tar block size" .
257 However, this term is a little bit confusing, since
258 it does not mean the number of bytes in a block.
259 Thus a perhaps better name would be the
260 .IR "tar blocking factor" .
264 tar writes or reads its archive to or from tape in units of tar
266 As stated above, only a complete tape block may be transferred to/from
267 tape. To extract a specific tar block from tape, one has to
268 read an entire tape block into a buffer and extract
269 the specified tar record from the buffer manually.
270 If you would like to read a tar record with a given number,
271 you have to know the number of the first tape block of the archive
272 and the tar block size to compute the number of the tape block witch
273 contains the tar record to read.
274 If the tar archive is the first file on the tape, the
277 .IR "tar block number" .
280 A file with the tar record number 1234 (records start with 0)
281 may be found in a tape tar archive, written with a
282 blocking factor of 20.
283 It may be found in the tar block with the number
285 blk = (int) 1234/20 = (int) 61.7 = 61
287 which is also the tape block number.
288 The requested file is within this tar block at the record offset
290 rec = 1234-(61*20) = 14
294 If a current archive is not the first archive on the tape, then
297 of all previous archives has to be
298 added to the block number computed above,
300 .IR "current tape block number" .
301 The number of previous tape records
302 should be obtained from DDS devices
303 when the tape is positioned
304 at the beginning of the current archive (use
306 without arguments for example).
309 Assuming the archive in the above example to be the second file
310 on a tape, and the archive starts at tape block 20222.
311 Then we will find our file with tar record number 1234
314 tblk = 20222 + (int) 1234/20 = 20283
317 The record offset inside the tape block will be the same as above.
319 \"---------------------------------------------------------------------------
321 This program can only read records (tar is calling them tape blocks)
322 up to 32 kbytes due to the limitations of the Linux device driver.
323 The extracted archive is written to stdout with a
324 block size of 512 bytes.
327 The environment variable
329 overrides the default tape device /dev/tape.
331 .B DDS2TAR cat be used to give some options, e.g.
332 .B --compress, -z, -s # , -b #.
335 dds2index(1), mt(1), mt-dds(1), tar(1)
338 This program was created to use the fast seek operation of my DAT
339 streamer. The tapes are called dds (digital data storage).
340 Since the program will write a tar archive to stdout,
341 I called this program
343 If I created the index file, I'm now
344 able to restore a file of 1MB within one minute even if the tape
345 contains more than 2GB of data.
347 Thanks to Andreas (Andreas_Bagge@h2.maus.de), who has written a nice
348 manual page for the overloaded version 1.1.3 of the program dds2tar
349 (I added too much features ... )
350 His manual page for dds2tar-1.1.3 gave me the idea how to split the
351 program dds2tar into the peaces dds2tar, dds2index and mt-dds.
352 Additionally his manual page was the starting point for this page.
354 Since the version 2.2 has a very robust algorithm to read the index file
355 and the ability of pattern matching, a lot of options where obsolete
356 and has been deleted. I tried to make dds2tar as simple I can.
359 J"org Weule (weule@cs.uni-duesseldorf.de), Phone +49 211 751409.
360 This software is available at
361 ftp.uni-duesseldorf.de:/pub/unix/apollo and
362 sunsite.unc.edu:/pub/Linux/system/Backup