[HPADM] SUMMARY: Compressed tar archive riddle

Jean.Desrosiers_at_VISAER.com
Date: 05/04/04

  • Next message: Kurt Freydl: "[HPADM] change graphic resolution from 1024x768 to 1280x1024"
    To: hpux-admin@dutchworks.nl
    Date: Tue, 4 May 2004 07:55:53 -0400 
    
    
    

    Many thanks to those who took time to respond.

     

    The lesson here is to not discount the obvious "too simple to work" answer.

     

    THE QUERY....

    ===========================================================================

    Is it possible to create a tar tape from a compressed tar archive file, blah.tar.Z, without the need to extract and write the contents of the compressed archive to disk first? I need to duplicate a tape that I made months ago and disk space is an issue. Besides it's so inefficient.....

    I've tried a couple of combinations zcat'ing the archive and end up with the files being written to the directory I am in and nothing going to tape.

    I firmly believe that someone out there has the elusive one line command that will do it. Maybe something combined with dd?

     

    THE ANSWERS...

     

    ( From Eef Hartman, the answer I put to use. J )

    You don't want to put the COMPRESSED image onto the tape?

     

    If not:

       zcat filename.tar.Z | dd of=/dev/rmt/0m obs=<blocksize> should put the tarfile onto tape (fill in your own tape device and blocksize), while just pure

       dd if=filename.tar.Z of=/dev/rmt/0m bs=<blocksize>

    will put it COMPRESSED onto the tape (you might want to use the non-hardware compression tape device for this, if you got one, like:

    crw-r--r-- 2 bin bin 205 0x003000 Jun 4 2001 0hc

    crw-r--r-- 2 bin bin 205 0x003080 Dec 20 2002 0hcb

    crw-r--r-- 2 bin bin 205 0x003040 Dec 19 16:09 0hcn

    crw-r--r-- 2 bin bin 205 0x0030c0 Jun 4 2001 0hcnb

    crw-r--r-- 2 bin bin 205 0x003001 May 1 16:26 0m

    crw-r--r-- 2 bin bin 205 0x003081 Nov 20 2002 0mb

    crw-r--r-- 2 bin bin 205 0x003041 Sep 2 2002 0mn

    crw-r--r-- 2 bin bin 205 0x0030c1 Nov 3 2001 0mnb

    crw-r--r-- 2 bin bin 205 0x003000 Jun 4 2001 c0t3d0BEST

    crw-r--r-- 2 bin bin 205 0x003080 Dec 20 2002 c0t3d0BESTb

    crw-r--r-- 2 bin bin 205 0x003040 Dec 19 16:09 c0t3d0BESTn

    crw-r--r-- 2 bin bin 205 0x0030c0 Jun 4 2001 c0t3d0BESTnb

    (the "BEST" ones are automatic generated, with BEST compression, the 0hc* ones are links TO those, while the 0m* ones are with compression DISABLED, this is for a DDS tape drive on SCSI bus 0, address 3 on a 735). As you can see the bit with value 1 disables compression here (minor).

     

    Note that the 0* ones have been generated by ME, are not the default ones.

     

     

    Try this:

     

    zcat blah.tar.Z > /dev/rmt/0m

    ( It works but when tabling the resultant tape tar complains about reaching the end of tape and requires user input to continue. J )

     

    The slightly fancier version, functionally equivalent unless your tape drive is very picky about blocking factor:

     

    zcat blah.tar.Z | dd of=/dev/rmt/0m bs=10240 ( Same as first best working answer J)

     

    The block size of 10240 emulates the default blocking factor of "tar".

     

        haven't you tried the 'obvious' ? :

    (there's that obvious thing I foolishly discounted in favor of a more complex solution. J )

     

         uncompress < blah.tar.Z | dd of=YOUR_TAPE_DEVICE obs=10k

     

         (or : zcat blah.tar.Z | dd of=YOUR_TAPE_DEVICE obs=10k )

     

        10k is the (age old) 'tar' block-size ...

     

    hope this helps,

     

     

    If the origional is on tape and the target is an other tape and you have 2

    tapedrives, you can do it on the fly. There are 2 basic unix 'trics' involved:

    pipelining and the fact that everything can be handled as a file...

     

    dd if=/dev/source-tape of=/dev/target-tape

    Or from your blah.tar.Z file:

    dd if=blah.tar.Z of=/dev/target-tape

     

    If the source is compressed and you don't want that on the target, just

    uncopmress on the fly.

     

    zcat /dev/source-tape | dd of=/dev/target-tape

    Or from your blah.tar.Z file:

    zcat blah.tar.Z | dd of=/dev/target-tape ( once again, the elegant solution...J )

     

     

    J Desrosiers

    jean.desrosiers@visaer.com

     

    
    

    --
                 ---> Please post QUESTIONS and SUMMARIES only!! <---
            To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
           Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
     
     Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
                http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
    

    image001.jpg
  • Next message: Kurt Freydl: "[HPADM] change graphic resolution from 1024x768 to 1280x1024"

    Relevant Pages

    • Re: DAT/DDS tape backups...
      ... >DDS-4 drive complete with a 8 tape cassette autoloader. ... >At least that is how the specifications for these drives (and all ... >With compression turned off, I get 19459MB to tape, with it on, I get ... Don't feed the hardware compressor already ...
      (Fedora)
    • Re: Why does measuring tape bend one way?
      ... > into tension and the edges into compression. ... > tape is thin compared to the length over which the compressive ... > slight curve with the energy released by the compressive force ... > moving as the deformation allows the force to move. ...
      (sci.physics)
    • Re: Adaptec 1542C with NT4
      ... Today I restored NTBackup from WinNT 3.1 and WinNT 3.5 installations. ... Backup made backups. ... Is it possible that the tape drive has been changed or had hardware ... hardware compression.) ...
      (comp.periphs.scsi)
    • Re: SBS Backup failures
      ... and your tape manufacturer lies about the capacity of tape. ... MAXIMUM compression ratio to be achieved by the technology. ... Backup device is internal SCSI HP 36/72 DAT ... Will enumerate on 3 media libraries found. ...
      (microsoft.public.windows.server.sbs)
    • Re: backup compress on the fly
      ... >>The point is that, if there is an error, all the CRCs in the ... > off the tape .. ... > there's an asumption that you only have 1 compressed file ... the "z" compression option specified, which results in a single tar ...
      (Debian-User)