[comp.unix.xenix.sco] Compressing to a Tape Drive

neal@mnopltd.UUCP (02/14/91)

I gleaned the following sort of snippet of script from the i386 group to 
	make a cpio backup
	compress it
	increase the blocking to reduce the "shoe-shining" effect

find usr2 -print >> /tmp/bkup.names
cat /tmp/bkup.names | cpio -ocvB | compress | dd ibs=5120 obs=512k > /dev/rct0

However, it seems that dd cannot perform output to the tape drive under any
set of parameters without getting a write error on the last block.    

Even:
	dd ifs=/tmp/moo ofs=/dev/rct0
will generate a write error and, when copied back, the file will be missing
the last N hundred bytes.  (where N depends on the blocking factor)

(BTW: the drive and tape work fine with tar and cpio)  The drive is a Wantek
5150pk and I do have the software patch for it.    Have I blown my valves
or is there maybe a buglet here?


------------------------------------------------------------------------------
Neal Rhodes                       MNOP Ltd                     (404)- 972-5430
President                Lilburn (atlanta) GA 30247             Fax:  978-4741
                             emory!mnopltd!neal 
------------------------------------------------------------------------------

gene@zeno.mn.org (Gene H. Olson) (03/09/91)

itkin@mrspoc.Transact.COM (Steven M. List) writes:

>tar and cpio used fixed size blocks.  dd by default writes a partial block
>if the last block is not fully sized.  In this case it sometimes helps to
>use the "conv=sync" option to dd.  This forces ALL blocks to be the same
>size and will force the last block out to full size.

Be careful using conv=sync when dd is fed by a pipe.  If for any
reason it reads a partial block from the pipe (and there are lots
of ways that can happen) it will pad out that block to full size.
If that happens in the middle of your archive, you are screwed,
and you may not discover it until you really need that archive.

Ideally, your data compression program should do the padding for
you.  The "compact" program I posted to the net some time ago does
that automatically.
_________________________________________________________________________
   __ 
  /  )                Gene H. Olson             gene@zeno.mn.org
 / __  _ __  _                             
(__/ _(/_//_(/_                                 gene@digibd.com