1826968 Members
4316 Online
109705 Solutions
New Discussion

Re: cpio on hp-ux 10.20

 
SOLVED
Go to solution
Tammy Liang
Regular Advisor

cpio on hp-ux 10.20

I tried to restore a cpio file from tape with command " cpio -idcmv < /dev/rmt/0m". I got "End of Volume. If you want to go on, type device/file name when ready"
What is "End ov Volume" mean?
I enter "/dev/rmt/0m" and see the size of restored file increased.
What's the cpio command for listing the content of the tape drive?

Thanks for any reply.

Tammy
take easy, enjoy life
16 REPLIES 16
Pete Randall
Outstanding Contributor

Re: cpio on hp-ux 10.20

You might need to rewind the tape first:

mt rew

It sounds to me like you're at the end of the tape.


Pete

Pete
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

I did not rewind the tape,just enter the tape device file /dev/rmt/0m. Does cpio rewind on its own?
tks
take easy, enjoy life
Johnson Punniyalingam
Honored Contributor

Re: cpio on hp-ux 10.20

Hi Tammy,

>>> I did not rewind the tape,just enter the tape device file /dev/rmt/0m. Does cpio rewind on its own? <<

NO, It doesn't rewind on its own. we have to rewind , please follow the rewind command

# mt -f /dev/rmt/0mn status
(will show you tape is ONLINE)

# mt -f /dev/rmt/0mn rewind

Than try with cpio command for Listing .. :)

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Dennis Handly
Acclaimed Contributor
Solution

Re: cpio on hp-ux 10.20

>What is "End of Volume" mean?

It means what it says. You are at the end of the tape reel. You need to "mount" another.

>I enter "/dev/rmt/0m"

I assume you first ejected the tape and put the next volume there?

>What's the cpio command for listing the content of the tape drive?

I suggest you give up on tar(1) and cpio(1) and only use pax(1).
You simply use:
pax -tv -f /dev/rmt/0m

>Pete: You might need to rewind the tape first

Are you suggesting the tape was first written and now read, without rewinding?
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

All,
Thanks for the reply.I did not eject/rewind the tape. I just entered the same device name and cpio append the file to the same file name. Looks like cpio handle the rewind part.

Tammy
take easy, enjoy life
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

All,
How can I setup block size with cpio to restore file?
I'm using "cpio idcmv < /dev/rmt/0m".

Thanks.
take easy, enjoy life
OldSchool
Honored Contributor

Re: cpio on hp-ux 10.20

as far as I know, you can't. it is what it is.

man "cpio" seems to indicate that it deals in 512 byte blocks.

one wonders why you ask
Dennis Handly
Acclaimed Contributor

Re: cpio on hp-ux 10.20

>How can I setup block size with cpio to restore file? I'm using "cpio idcmv < /dev/rmt/0m".

Do you know what the block size is? You have N options, use -B for 5120 bytes, use a pipe with dd to reblock or good old pax(1).

>OldSchool: as far as I know, you can't. it is what it is. one wonders why you ask

See above. It would also be helpful to know how it was written to tape?

Also, as I mentioned, pax(1) will magically figure out how to read your tape. See:
-b blocking Blocking is automatically determined on input.
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

I don't know how the file cpio to tape.
It was old tape that we need to restore for
oracle data. After restore the file
with cpio, oracle import failed. I restored
the files from 2 different tapes, and imp failed on both of export files.
So the bottom line is you can not setup block size for cpio when restore from the tape drive.
take easy, enjoy life
OldSchool
Honored Contributor

Re: cpio on hp-ux 10.20

"So the bottom line is you can not setup block size for cpio when restore from the tape drive."

see Dennis' reply above. He notes -B will reset the block size to 5120.

better yet, he suggested (twice) that you use "pax" instead, which will sort out the blocking correctly.

having hit "End of Volume" and continued on using the same tape w/o rewind makes me wonder how the tape was produced in the first place.
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

So I can pax to restore the file that created via cpio? If so, what's the command?

Can you provide the cpio commands that I can use with -B and dd for getting cpio file from /dev/rmt/0m?

Tks.
take easy, enjoy life
Dennis Handly
Acclaimed Contributor

Re: cpio on hp-ux 10.20

>So I can pax to restore the file that created via cpio?

Yes: pax -rv -f /dev/rmt/0m

>Can you provide the cpio commands that I can use with -B and dd for getting cpio file from /dev/rmt/0m?

-B works only if you used -B to write it.

Using dd(1) is completely separate more complicated approach.
Some threads:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1281104
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1163073
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1252713
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1229193
James R. Ferguson
Acclaimed Contributor

Re: cpio on hp-ux 10.20

Hi Tammy:

I would add, for your further information, that 'cpio' cannot archive 'largefiles' (files > 2GB).

With 'pax', when Using '-x cpio' or '-x ustar' files up to 8GB can be archived.

In 11.31 or in 11.23 with the PAX_ENH product installed, 'pax' can archive files larger than 8GB.

HP is making 'pax' a defacto standard for HP-UX and is in fact, deprecated (the extremely useful but proprietary) 'fbackup' utility.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: cpio on hp-ux 10.20

Hi (again) Tammy:

Oh, the above is just another reason to move from the unsupported, ancient 10.20 release to at least 11.11.

I keep missing the fact that you noted your release as 10.20.

Regards!

...JRF...
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

Thanks all. We moved from hp-ux to redhat linux. For this particular case, I need to restore file that was created years ago on hp-ux 10.20 with cpio command to get some oracle data out...
I will try the "pax" command.

Tks.

Tammy
take easy, enjoy life
Tammy Liang
Regular Advisor

Re: cpio on hp-ux 10.20

All, the pax does work. file was restored and
imported to database.

Tks for all reply.
take easy, enjoy life