Operating System - HP-UX
1835444 Members
2348 Online
110078 Solutions
New Discussion

How to dump a tar archive from a tape?

 
SOLVED
Go to solution
Romaric Guilloud
Regular Advisor

How to dump a tar archive from a tape?

Hello there,
I do have a tar archive on a DDS-2 tape that I want to dump as a file.tar on a File System.
I first tried:
>dd if=/dev/rmt/0m of=/tmp/file.tar
but the file.tar obtained is no longer respecting the tar format then.
Secondly, i tried to combine:
>tar xf /dev/rmt/0m . |tar cvf file.tar .
but I can't manage to make it.
Any clever idea :-) ???
Thanks in advance.

Romaric.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
14 REPLIES 14
Ian Dennison_1
Honored Contributor

Re: How to dump a tar archive from a tape?

tar -tf /dev/rmt/0m

What does this produce?

Share and Enjoy! Ian
Building a dumber user
Romaric Guilloud
Regular Advisor

Re: How to dump a tar archive from a tape?

Well,
As expected, tar tvf /dev/rmt/0m lists the names of all the files in the archive.
My question is how to produce in one shot the tar file, i.e. copying it from the tape media to a FS.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
melvyn burnard
Honored Contributor

Re: How to dump a tar archive from a tape?

try adding a block size change to hte command:
dd if=/dev/rmt/0m of=/tnmp/file.tar bs=10k
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Michael Steele_2
Honored Contributor

Re: How to dump a tar archive from a tape?

This is the delimma faced when backing up 'relative' or 'absolute'.

When you list out the files is the '/' present in every pathway?

This is 'absolute' which translates to 'overwrite'.

So try 'PAX' instead of 'TAR'. 'PAX' will translate both tar and cpio:

cd
pax -rv -s'/^\///'
Support Fatherhood - Stop Family Law
Romaric Guilloud
Regular Advisor

Re: How to dump a tar archive from a tape?

Melvin,
I gave a try with bs=10k.
Then when passing a tar tvf or xvf on the file.tar, I get:
>Tar: error! blocksize changed
Still not making it :-(
Romaric.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
melvyn burnard
Honored Contributor

Re: How to dump a tar archive from a tape?

interesting. I have always used this to duplicate tar archives to or from tapes to file systems.
The tar archive wasn't perhaps created by changing the block size in the first place?
what do you get if you do tar vtf /dev/rmt/0m?
and if you try to recover the files to disc with xvf?

The other idea would be to use pax
man pax
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Elena Leontieva
Esteemed Contributor

Re: How to dump a tar archive from a tape?

What command/utility did you use to put this file.tar on tape?
Ian Dennison_1
Honored Contributor

Re: How to dump a tar archive from a tape?

Romanic,

If the "tar -tf" command shows individual files, then I cannot imagine that you can "unbundle" then "rebundle" the files using 1 tar command.

If the files listed are individual, they will be need to be specified individually in the tar extract command. If the file listed have a path in them, specify the directory in the tar extract command.

Share and Enjoy! Ian
Building a dumber user
Romaric Guilloud
Regular Advisor

Re: How to dump a tar archive from a tape?

Melvin,
In the first place, my tar archive was created with:
>tar cvf /dev/rmt/0m
I didn't specify any block size at this point.

tar vtf /dev/rmt/0m produces once again the expected list of files in the archive and I'm of course able to recover them onto a disc.
Once again, my concern is:

PRODUCING a ARCHIVE TAR FILE from the TAPE onto a FILE SYSTEM, i.e. NOT retrieving the files directly but rather the ARCHIVE.

I tried to compose with a pipe the following:
>tar xf /dev/rmt/0m | tar cvf file.tar, but can't manage to make it work.

I'll definitely look into pax...
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
V. Nyga
Honored Contributor

Re: How to dump a tar archive from a tape?

Hi Romaric,

try a blocksize of 1024: bs=1024

Second solution:
You can extract all files of the tape?
Then extract to /tmp/tar (tar for example so you have an empty directory) and then do a tar cvf file.tar /tmp/tar/* and you will have your dump without problems.

Volkmar
*** Say 'Thanks' with Kudos ***
V. Nyga
Honored Contributor

Re: How to dump a tar archive from a tape?

Sorry

1024k

Volkmar
*** Say 'Thanks' with Kudos ***
Romaric Guilloud
Regular Advisor

Re: How to dump a tar archive from a tape?

Dear Michael,
The pax made it!
Thanks a bunch for your help.
Please drop me a quick reply, if you know what I mean... (you guess the purpose, you deserve it).
Also, please explain the double slashing (//) in the pax command; I didn't get it...
Thanks again.

Romaric.
"And remember: There are no stupid questions; there are only stupid people." (To Homer Simpson, in "The Simpsons".)
melvyn burnard
Honored Contributor

Re: How to dump a tar archive from a tape?

The -s'/^\///' in the pax command line is removing hte / from hte front of the file pathname, i.e. it is changing it from absolute path to relative path naming.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Michael Steele_2
Honored Contributor
Solution

Re: How to dump a tar archive from a tape?

You betcha.

PAX is the backup utility used by ignite and is also great for discovering an unknown tape format and contents.
Support Fatherhood - Stop Family Law