For some unknown reason, Oracle considers it necessary to distribute their UNIX software in .cpio files. Since this is the only time I ever use cpio, I can never remember the command and I always end up looking it up.
Well, for future reference, here is how you extract a .cpio file to the current directory on most platforms:
cpio -idmv < filename_to_extract.cpio
Some platforms, like AIX, may give errors like this with these options:
cpio: 0511-903 Out of phase!
cpio attempting to continue...
cpio: 0511-904 skipping 732944 bytes to get back in phase!
One or more files lost and the previous file is possibly corrupt!
cpio: 0511-027 The file name length does not match the expected value.
If you run into these you need to add the c
option as the headers are stored in ASCII. The command should now look like this:
cpio -idcmv < filename_to_extract.cpio
For more information refer to the man page for cpio, but this is all I ever do with cpio. For a better UNIX archiving utility, consider tar.
On HP-UX 11 I needed to add the -c option. I share your frustration with these cpio files.
Good to know. Thanks Tom!
cpio -idmv
thanks, helpful in extracting oracle application server 10g on sun solaris
Finally an actual usable example of cpio.
Thanks very much LAC 🙂
Exactly what I needed – thanks for the info.
i have the same problems with informix and hp/ux distributions. thanks for the examples!
I did exactly what you said, but still can not deal with oracle cpio files.
My OS is CentOs4.4
Any suggestion?
I did it.
I use [cat cpio_filename.cpio | cpio -icd].
Thanks for sharing Andrew. I haven’t run into this problem, but I haven’t had much contact with CentOs.
This is exactly what I needed .Thank you
From my experience of moving installs around, some versions of tar don’t like working with very large tarballs. Solaris 8 was particularly bad – so I guess that’s why they don’t use it.
Thanks! You betcha I was installing oracle and I was like WHAT THE HECK IS THIS!? Zip Na RAR no. Tar ball no.. Gzip Nope… Thanks for the post!
Robert
Thanks! You betcha I was installing oracle and I was like WHAT THE HECK IS THIS!? Zip Na RAR no. Tar ball no.. Gzip Nope… Thanks for the post!
Robert
O my lord! A website that does not give me 1000pages of garbage to read! Thank You so much….. =)
Very helpful, and I just LOVE the Story Pulse graph at the bottom of the page, too.
Thanks for sharing this, because I thought that cpio were corrupted and was thinking downloading cpio files again.
Just a note: I didn’t have to put extra “c” parameter on Debian/Ubuntu/Centos4/Centos5
Regards
I was railing at my teammates about Oracle and their silly cpio files – then googled – and found you expressing the exact same sentiment. Thank you so much for this command! I am running right now… 🙂
Wow, looking at your site it like stepping into an alternate universe. Both of our sites have a coffee theme and contain little tips about unix and databases. I love your coffee bean header.
c ya
John Rigler
dead1ec0ffee
For same reason, I keep coming back to this page as well. Thanks for this post!!!
Thanks! Just what I needed.