Operating System - HP-UX
1748011 Members
3645 Online
108757 Solutions
New Discussion юеВ

Re: extracting files via cpio

 
SOLVED
Go to solution
Jerry_109
Super Advisor

extracting files via cpio

Hello HP,

DBA received a file from oracle in cpio format to be extracted on our HP system. We receive the errors listed below when trying to extract the file(s). Please advise.
######################################

# uname -a ; model
HP-UX B.11.11 9000/800/A500-7X
#########################################


# swlist -l bundle | grep -i cpio
root@fdhp58[/u99/oradata/stage/bpel]
# swlist -l product | grep -i cpio
PHCO_24440 1.0 cumulative cpio(1) patch
root@fdhp58[/u99/oradata/stage/bpel]
# swlist -l fileset | grep -i cpio
# PHCO_24440 1.0 cumulative cpio(1) patch
######################################

#[/u99/oradata/stage/bpel]
# ll
total 1835312
drwxr-xr-x 3 oracle dba 96 Mar 22 10:40 Components
-rwxr-xr-x 1 oracle dba 313217024 Mar 21 18:46 as_hpux_parisc_bpel_101202.cpio
-rwxr-xr-x 1 oracle dba 313217024 Mar 22 10:03 as_hpux_parisc_bpel_101202_2.cpio
-rw-r--r-- 1 oracle dba 122 Nov 15 2004 compHlp.class
drwxr-xr-x 3 oracle dba 96 Mar 22 10:40 oracle
-rwxr-xr-x 1 oracle dba 313217024 Mar 22 10:39 test.cpio.Z
root@fdhp58[/u99/oradata/stage/bpel]
# file as_hpux_parisc_bpel_101202.cpio
as_hpux_parisc_bpel_101202.cpio: ASCII cpio archive
root@fdhp58[/u99/oradata/stage/bpel]
# file as_hpux_parisc_bpel_101202_2.cpio
as_hpux_parisc_bpel_101202_2.cpio: ASCII cpio archive
root@fdhp58[/u99/oradata/stage/bpel]
# bdf .
Filesystem kbytes used avail %used Mounted on
/dev/vg01/u99 81920000 37323520 44248616 46% /u99

###################################
root@fdhp58[/u99/oradata/stage/bpel]
# cpio -icvt < as_hpux_parisc_bpel_101202.cpio
Out of phase--get help
Perhaps the "-c" option shouldn't be used


root@fdhp58[/u99/oradata/stage/bpel]
# cpio -ivt < as_hpux_parisc_bpel_101202.cpio
Out of phase--get help
Perhaps the "-c" option should be used


#########################################
13 REPLIES 13
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: extracting files via cpio

First, make sure that the file that he received was transferred in binary format at eveery step along the way. It's possible that the file is byte-swapped so that it might be necessary to run it thru dd.

As a first step I would dd off the first 1KB from the file and run it thru od. Post that and we will at least know if it is a cpio image (or if it's byte flipped).

dd if=as_hpux_parisc_bpel_101202.cpio bs=1k count=1 | od -v -Ad -tco > cpio.txt

Then post cpio.txt and someone should be able to help.
If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: extracting files via cpio

Shalom,

http://www.brandonhutchinson.com/cpio_command.html

http://www.lifeaftercoffee.com/2005/10/25/what-the-heck-do-i-do-with-a-cpio-file/

Mostly, I just cut and paste thre proper commands from the originating website. I'm lazy that way.

I think your file is corrupt, based on the message.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jerry_109
Super Advisor

Re: extracting files via cpio

root@fdhp58[/u99/oradata/stage/bpel]
# dd if=as_hpux_parisc_bpel_101202.cpio bs=1k count=1 | od -v -Ad -tco > cpio.txt
1+0 records in
1+0 records out
root@fdhp58[/u99/oradata/stage/bpel]
A. Clay Stephenson
Acclaimed Contributor

Re: extracting files via cpio

The Force is not with me today. I am unable to sense the contents of cpio.txt. Perhaps you should POST the contents of that file.
If it ain't broke, I can fix that.
Jerry_109
Super Advisor

Re: extracting files via cpio

0000032 0 0 0 2 3 2 0 0 0 0 0 0 0 1 4 0
000006014030062 000006314430060 000006014030060 000006014232060
0000048 d 8 c 0 5 4 0 0 0 0 0 9 d 4 0 0
000014416061460 000006515030060 000006014030071 000014415030060
0000064 0 0 0 0 0 0 0 0 0 0 0 0 1 a 0 0
000006014030060 000006014030060 000006014030060 000006130230060
0000080 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000006014030060 000006014030060 000006014030060 000006014030060
0000096 0 0 0 0 2 1 0 0 0 0 0 0 0 0 C D
000006014030060 000006214230060 000006014030060 000006014041504
0000112 1 / d o c / d c o m m o n / g i
000006113662157 000014313662143 000015733266557 000015613663551
0000128 f s / b o o k b i g . g i f \0 \0
000014634627542 000015733665542 000015131627147 000015131400000
0000144 G I F 8 9 a 036 \0 $ \0 367 \0 \0 377 377 377
000010722243070 000007130217000 000004400173400 000000077777777
0000160 \b \b \b 020 020 020 030 030 030 ! ! ! ) ) ) 1
000001002004020 000002004014030 000003010220441 000005112224461
0000176 1 1 9 9 9 B B B J J J R R R Z Z
000006114234471 000007120441102 000011222445122 000012224455132
0000192 Z c c c k k k s s s { { { 204 204 204
000013230661543 000015332665563 000016334675573 000017341102204
0000208 214 214 214 224 224 224 234 234 234 245 245 245 255 255 255 265
000021443106224 000022445116234 000023451322645 000025553326665
0000224 265 265 275 275 275 306 306 306 316 316 316 326 326 326 336 336
000026555336675 000027561543306 000031663547326 000032665557336
0000240 336 347 347 347 357 357 357 367 367 367 275 265 265 224 214 214
000033671763747 000035773767767 000036775736665 000026545106214
0000256 s k k B 9 9 1 ) ) ) ! ! B 1 1 030
000016332665502 000007116230451 000005112220441 000010214230430
0000272 020 020 ) 030 030 ) 020 020 020 \0 \0 1 ! 030 020 \b
000002004024430 000003012210020 000002000000061 000004106010010
0000288 \0 J B 9 B 9 ! ! 030 \0 c Z 9 367 367 357
000000022441071 000010216220441 000003000061532 000007175773757
0000304 377 377 367 316 316 306 255 255 245 265 265 255 306 306 275 234
000037777773716 000031661526655 000024555332655 000030661536634
0000320 234 224 245 245 234 214 214 204 s s k 204 204 { Z Z
000023445122645 000023443106204 000016334665604 000020436655132
0000336 R c c Z R R J J J B B B 9 204 204 c
000012230661532 000012224445112 000011220441102 000007141102143
0000352 ! ! 030 020 020 \b 306 316 275 316 326 316 ) 1 ) 020
000004110214020 000002002143316 000027563553316 000005114224420
0000368 030 020 \b 020 \b k { s 357 367 367 326 336 336 336 347
000003004004020 000001032675563 000035775773726 000033667557347
0000384 347 265 275 275 245 255 255 275 306 306 214 224 224 k s s
000034755336675 000024553326675 000030661506224 000022432671563
0000400 306 326 326 275 316 316 Z c c J R R 234 255 255 B
000030665553275 000031663455143 000014322451122 000023453326502
0000416 J J 204 224 224 { 214 214 9 B B ) 1 1 ) 9
000011222502224 000022436706214 000007120441051 000006114224471
0000432 9 \b 020 020 020 ! ! 020 ) ) \b 030 030 020 1 1
000007102010020 000002010220420 000005112204030 000003004030461
0000448 \b ! ! \0 \b \b k 204 214 234 306 326 ! J Z \0
000001010220400 000001002065604 000021447143326 000004122455000
0000464 030 ! ) R c 020 J c c 204 224 B c s 030 )
000003010224522 000014304045143 000014341112102 000014334614051
0000480 1 c 255 316 ) J Z ! B R 020 ! ) 020 B Z
000006130726716 000005122455041 000010224410041 000005104041132
0000496 \b ) 9 234 275 316 030 9 J ! R k 9 245 336 !
000001012234634 000027563414071 000011210251153 000007151357041
0000512 c 204 1 224 306 020 1 B ) 224 316 030 Z { 255 275
000014341030624 000030604030502 000005145147030 000013236726675
0000528 306 ) 9 B k 265 336 c 255 326 1 k 214 B 234 316
000030612234502 000015355357143 000025565430553 000021420516316
0000544 9 224 306 030 B Z ! Z { 9 255 357 030 R s )
000007145143030 000010226420532 000017316326757 000003024471451
0000560 214 306 020 J k 245 316 347 k 224 255 s 265 336 k 255
000021461410112 000015351347347 000015345126563 000026567465655
0000576 326 9 k 214 B 224 306 1 s 234 1 214 306 030 J k
000032616265614 000010245143061 000016347030614 000030606045153
0000592 020 9 R 234 265 306 245 306 336 c { 214 k 245 316 9
000002016251234 000026561522706 000033630675614 000015351347071
0000608 s 234 ) Z { 1 k 224 9 214 306 1 204 275 ) s
000016347024532 000017314265624 000007143143061 000020457224563
0000624 245 1 R k ) J c 020 1 J 234 245 255 234 255 275
000024514251153 000005122461420 000006122516245 000025547126675
0000640 030 ! ) ) B Z 020 ! 1 316 326 336 k { 214 c
000003010224451 000010226410041 000006163553336 000015336706143
0000656 s 204 c { 224 \b 030 ) 1 9 B 020 030 ! 030 )
000016341061573 000022402014051 000006116241020 000003010214051
0000672 B c s 214 c 204 316 { 214 265 k 204 306 s 204 265
000010230671614 000014341147173 000021455265604 000030634702265
0000688 c { 275 k 204 316 Z s 275 020 ! R k 204 326 J
000014336736553 000020463455163 000027504020522 000015341153112
0000704 k 316 J k 326 204 224 316 c { 316 9 Z 316 k s
000015363445153 000032641112316 000014336747071 000013263465563
0000720 224 { 204 255 c k 214 9 R 265 ) B 245 k s 234
000022436702255 000014332706071 000012255224502 000024532671634
0000736 9 R 316 9 R 326 1 J 306 ! ) Z 1 B 255 !
000007124547071 000012265430512 000030610224532 000006120526441
0000752 ) c ) 9 245 ) 9 265 9 B 234 \b 020 R 1 9
000005130624471 000024512234665 000007120516010 000002024430471
0000768 245 367 367 377 k k s B B J c c { c c 204
000024575773777 000015332671502 000010222461543 000017330661604
0000784 B B Z ) ) 9 k k 234 ! ! 1 020 020 030 9
000010220455051 000005116265553 000023410220461 000002004014071
0000800 9 c 1 1 Z B B { 030 030 9 ! ! R ! !
000007130630461 000013220441173 000003006034441 000004124420441
0000816 Z \b \b 030 ! ! c ) ) 204 ! ! k 030 030 R
000013202004030 000004110261451 000005141020441 000015306014122
0000832 ! ! s ! ! 204 020 020 B 030 030 c 030 030 k 030
000004110271441 000004141010020 000010206014143 000003006065430
0000848 030 s 020 020 R 020 020 Z \b \b 1 020 020 c \b \b
000003034610020 000012204010132 000001002030420 000002030604010
0000864 9 \b \b B \0 \0 \b \0 \0 020 \0 \0 030 \0 \0 )
000007102004102 000000000004000 000000004000000 000003000000051
0000880 030 020 R 9 1 c 1 ) Z ! 030 R 020 \b 9 B
000003004051071 000006130630451 000013210214122 000002002034502
0000896 9 k 1 ) R c Z { ) ! 1 B 9 J B 9
000007132630451 000012230655173 000005110230502 000007122441071
0000912 B ) ! ) 030 020 030 J 9 B \0 \0 \0 ! 376 &
000010212220451 000003004014112 000007120400000 000000010377046
0000928 I m p o r t e d f r o m
000004010044555 000016033671164 000014531020146 000016233666440
0000944 G I F i m a g e : b o o k b
000010722243040 000015133260547 000014516420142 000015733665542
0000960 i g . g i f \0 , \0 \0 \0 \0 036 \0 $ \0
000015131627147 000015131400054 000000000000000 000003600022000
0000976 207 377 377 377 \b \b \b 020 020 020 030 030 030 ! ! !
000020777777777 000001002004020 000002004014030 000003010220441
0000992 ) ) ) 1 1 1 9 9 9 B B B J J J R
000005112224461 000006114234471 000007120441102 000011222445122
0001008 R R Z Z Z c c c k k k s s s { {
000012224455132 000013230661543 000015332665563 000016334675573
0001024
root@fdhp58[/u99/oradata/stage/bpel]
A. Clay Stephenson
Acclaimed Contributor

Re: extracting files via cpio

You still missed the boat. I need the very first lines of cpio.txt. You posted the 3rd line starting at byte offset 32(dec). The magic number (this ia a real technical term) which identify the format is stored as the first bytes so you need to post all of this file beginning at offset 0.
If it ain't broke, I can fix that.
Jerry_109
Super Advisor

Re: extracting files via cpio

# cat cpio.txt
0000000 0 7 0 7 0 1 0 0 0 1 3 e d 7 0 0
000006015630067 000006014230060 000006014231545 000014415630060
0000016 0 0 8 1 b 6 0 0 0 0 5 6 f 9 0 0
000006014034061 000014215430060 000006014032466 000014616230060
0000032 0 0 0 2 3 2 0 0 0 0 0 0 0 1 4 0
000006014030062 000006314430060 000006014030060 000006014232060
0000048 d 8 c 0 5 4 0 0 0 0 0 9 d 4 0 0
000014416061460 000006515030060 000006014030071 000014415030060
0000064 0 0 0 0 0 0 0 0 0 0 0 0 1 a 0 0
000006014030060 000006014030060 000006014030060 000006130230060
0000080 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
000006014030060 000006014030060 000006014030060 000006014030060
0000096 0 0 0 0 2 1 0 0 0 0 0 0 0 0 C D
000006014030060 000006214230060 000006014030060 000006014041504
0000112 1 / d o c / d c o m m o n / g i
000006113662157 000014313662143 000015733266557 000015613663551
Rodney Hills
Honored Contributor

Re: extracting files via cpio

You have the correct syntax. Is it possible the file is corrupt?

Enter-
file as_hpux_parisc_bpel_101202.cpio

And see if it sees it as a cpio file.

HTH

-- Rod Hills
There be dragons...
John Dvorchak
Honored Contributor

Re: extracting files via cpio

I usually use

cpio -idmv < filename_to_extract.cpio

Since you are getting the out of phase error I wonder if adding the -R switch wouldn't help.

From the cpio man page:

R Resynchronize automatically when cpio goes "out of
phase", (see DIAGNOSTICS).

If it has wheels or a skirt, you can't afford it.