1829156 Members
2309 Online
109986 Solutions
New Discussion

cpio

 
Prathap_1
Advisor

cpio

Hi
I am trying to read the contents of the tape with the cpio -icBvt /dev/rmt/1m. It is getting hanged there. Can anyone help me out. Help me out in extracting the tape to disk.

Thanks
Prathap.
29 REPLIES 29
harry d brown jr
Honored Contributor

Re: cpio


DO this:

dd if=/dev/rmt/1m of=/large_diskarea


live free or die
harry
Live Free or Die
Sanjay_6
Honored Contributor

Re: cpio

Hi Pratap,

Try

cpio -itBv < /dev/rmt/1m

Are you using the redirector "<". Also You are using the "c" as well as "t" option,

c --> Copy (extract)
t --> List Contents (No extract)

Try this,

cpio -itBvdl < /dev/rmt/1m
to list contents of tape

cpio -icBvdul < /dev/rmt/1m
to extract contents of tape to disk. Keep an eye on the path it is extracting to.

Hope this helps.

Regds
S.K. Chan
Honored Contributor

Re: cpio

You must use the same options to read the tape that were used to write it.
# cpio -itcvB < /dev/rmt/1m
should work.
Prathap_1
Advisor

Re: cpio

Hi Sanjay
Thanks for the info. I have tried the options given by you. I am getting the error called 'Out of Phase--get help', Perhaps the C option should not be used.

Thanks
Prathap.
H.Merijn Brand (procura
Honored Contributor

Re: cpio

don't forget the (too large) block size in order not to miss any bits:

dd if=./dev/rmt/1m ibs=102400 of=tape.cpio
file tape.cpio

if cpio still has trouble reading the data, try to use GNU's version of cpio and omit the -c argument. GNU's cpio will try to find out itself and understands more cpio formats than native HP-UX cpio.

GNU cpio can be found and installed from e.g. ftp://download.xs4all.nl/pub/mirror/gnu/cpio/cpio-2.4.2.tar.gz (I couln't find a precompiler binary for HP-UX)
Enjoy, Have FUN! H.Merijn
Prathap_1
Advisor

Re: cpio

Hi Sanjoy
I tried the solutions given in the links. Still I am getting the error. If I specify the 'c' option, I am getting the error C option should not be used. I I did't specify the 'c' option, I am getting the error 'C' option should be used.

Thanks
Prathap.
H.Merijn Brand (procura
Honored Contributor

Re: cpio

Here's a precompiled GNU cpio binary

put it somewhere in your path and issue

# ncpio --io-size=102400 -i -t -v
and tell us what happens
Enjoy, Have FUN! H.Merijn
Aftab Sadiq
Advisor

Re: cpio

Hi Prathap,
Did you rewind the tape first? Rewind the tape first with
mt -t /dev/rmt/1m rew
and then use cpio command to list the contents

I hope this will help

Aftab

H.Merijn Brand (procura
Honored Contributor

Re: cpio

Tried myself to pick up that binary, but got a 404, maybe this helps

# cd /tmp
# gzip -d # ncpio --io-size=102400 -i -t -v
Enjoy, Have FUN! H.Merijn
Sanjay_6
Honored Contributor

Re: cpio

Hi Pratap,

ARe you able to list the contents of the archive.

cpio -itBvdul < /dev/rmt/1m

If you are able to do so, then try,

cpio -icBvdulR
You could be having a media problem. Have you tried with another media. Or you can try this media on another server.

Hope this helps.

Regds
jd-gt
Occasional Advisor

Re: cpio

One person suggested the below. Do you need to
rewind the tape inbetween the list command and the extract command?

mt -t /dev/rmt/1m
cpio -itBvdul < /dev/rmt/1m

If you are able to do so, then try,

mt -t /dev/rmt/1m
cpio -icBvdulR


Prathap_1
Advisor

Re: cpio

Hi Procura
Can you let me know where can I get the ncpio utility.

Thanks
Prathap.
Prathap_1
Advisor

Re: cpio

Hi
I have tried all the solutions, still I am not able to read the contents of the tape.

Thanks
Prathap.
Sanjay_6
Honored Contributor

Re: cpio

Hi Pratap,

Try this,

dd if=/dev/rmt/1m ibs=1024k obs=1k | cpio -it

Hope this helps.

Regds

Prathap_1
Advisor

Re: cpio

Hi Sanjay
I have tried but still getting the same error.

Thanks
Prathap.
melvyn burnard
Honored Contributor

Re: cpio

Have you tried using the pax command?
pax (Portable Archive eXchange) is able to read and save both tar and cpio format tapes.

man pax for examples.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Prathap_1
Advisor

Re: cpio

Hi Melvyn
Yeah. I have tried pax -r -f /dev/rmt/1m. Still I am not able to read the tape.

Thanks
Prathap.
Darrell Allen
Honored Contributor

Re: cpio

Hi Prathap,

Maybe I missed this, but what was the complete command line used to create the cpio archive?

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
melvyn burnard
Honored Contributor

Re: cpio

One more suggestion, use th e-c option in th ecommand line, but drop the -B option.
I have seen that cause similar problems in the past.
Of course you could have bad media after all this. ;-{
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
H.Merijn Brand (procura
Honored Contributor

Re: cpio

ncpio: s800 shared executable dynamically linked

(temporary) avalable from

http://home.hccnet.nl/h.m.brand/ncpio

Good luck
Enjoy, Have FUN! H.Merijn
Frank Slootweg
Honored Contributor

Re: cpio

We first need to be sure of the exact format of the tape, so please execute the following commands and post the resulting output:

mt -t /dev/rmt/1mnb # Note: Added "nb".
dd if=/dev/rmt/1m of=/tmp/record bs=64k count=1
ll /tmp/record
file /tmp/record
rm /tmp/record

Note that especially the output of the ll(1) command (gives the record size of the tape) and of the file(1) command (tries to identify the type of archive/file) is important.

Prathap_1
Advisor

Re: cpio

Hi Frank
I have tried using 'dd' command. Please find attached as the output of the 'dd' command.

Thanks
Prathap.
Helen French
Honored Contributor

Re: cpio

Hi Prathap,

Check this thread of Harry:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x29bc0bce6f33d6118fff0090279cd0f9,00.html

HTH,
Shiju

Life is a promise, fulfill it!