Link to home
Start Free TrialLog in
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)
Avatar of tfewster
tfewster
Flag of United Kingdom of Great Britain and Northern Ireland image

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!
you can get gnu cpio from bullfreeware or linux affinity kit.
SOLUTION
Avatar of gheist
gheist
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of nescioii
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.