Avatar of nescioii
nescioii
 asked on

cpio compatibility between linux and aix

We have some DDS3 tapes containing cpio archives; these were made on a linux system (don't know which flavour). Now we want to extract them on an AIX system (version 4.2.1.0), but constantly get the 'out of phase' error.
The original command to put them on tape (according to the person who did it): cpio- ovcB <FILENAME> >/dev/rmt0.
The command with which we try to extract: cpio -icvB </dev/rmt0, comes up with the abovementioned error. We tried changng the blocksize to different sizes and to a variable size, but to no success. We tried a diskdump (dd if=/dev/rmt0 bs=128k of=<FILENAME>.cpio) which indeed put the file on the aix system; however, the cpio on that file resulted again in 'out of phase'.
My question: are there known compatibility issues regarding the cpio command between linux and aix, and if so, how to solve it?

Regards,
Henk de Jong (not very much into unix)
Unix OS

Avatar of undefined
Last Comment
nescioii

8/22/2022 - Mon
tfewster

cpio is meant to be standard, but the -B option seems to be interpreted differently in every flavour of Unix :-(

Red Hat 9.0 man page for cpio says:
-B  :   Set the I/O block size to 5120 bytes. Initially the block size is 512 bytes.
http://linux.ctyme.com/man/man0417.htm

AIX 5.1 man page for cpio says:
B          : Performs block input and output using 512 bytes to a record.
C Value : Performs block input and output using the Value parameter times 512 bytes to a record. For instance, a -C2 flag changes the block input and output sizes to 1024 bytes to a record.
http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/cmds/aixcmds1/aixcmds1tfrm.htm

So try -C10 instead of the -B for the extract;  Of course, AIX 4.2 may use yet another interpretation, so I hope you have the man pages installed...

Good luck!
gheist

you can get gnu cpio from bullfreeware or linux affinity kit.
SOLUTION
gheist

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Gns

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
gheist

I found pax on OpenBSD to be compatible with old SVR4 cpio ( where Linux is not ) and recent gtar produces ( where no unix should be ), in case you choose NFS variation to solution.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
nescioii

ASKER
Hi people,

Thanx for all the answers. Unfortunately our AIX box broke down last week (!!!), so I was unable to test the solutions on the unix machine itsself. But then again, this gave me the opportunity to rip out the dds3 tapestreamer, connect it to a simple windows pc, boot it up with knoppix and try the cpio-tapes on this configuration. And.....it worked like a charm! The -c option with which the cpio-archives were made was the reason why aix 4.2 choked on it; couldn't read this kind of header info. Using on linux the -H newc flag did the trick.