1757960 Members
2681 Online
108866 Solutions
New Discussion юеВ

cpio portability

 
SOLVED
Go to solution
Jorge Prado_1
Advisor

cpio portability

Hello,
From HP-UX 11.i cannot read tapes generated in a system UNIX Svr4 of NCR, the command to create the tapes was the following one:
find * -print | cpio -ocv -C 51200> /dev/rmt/cptape3.

Does somebody have some idea?

Thank you.
10 REPLIES 10
John Poff
Honored Contributor

Re: cpio portability

Hi,

I'm guessing that you are running into a problem with the block size. If the -C option in your NCR cpio specifies the block size in bytes, your records will be 51200 bytes and the HP cpio probably can't deal with that.

You can try the '-B' option on the HP side. It specifies a record size of 5120 bytes, which is one-tenth the size of the record you specified on the SVR4 side. If that doesn't work, you might have to try making the tape on the NCR again and specify a block size of 5120.

What error message are you getting from the HP cpio command?

JP
LucianoCarvalho
Respected Contributor

Re: cpio portability

Hi,

Are you receving any message when try to restore the files?
Have you tried to use -R option durig restore?

regards
Frank Slootweg
Honored Contributor

Re: cpio portability

Common problem. cpio has (too) many options and some implementations do not conform to the standard(s).

If possible, try to switch to tar(1).

If that is not possible, then try to switch to pax(1), at least on the reading side.

If that is not possible, do the following and post the results:

mt -t /dev/rmt/...nb
dd if=/dev/rmt/...n of=/tmp/record1 bs=1024k count=1
dd if=/dev/rmt/...n of=/tmp/record2 bs=1024k count=1
ll /tmp/record1 /tmp/record2
file /tmp/record1
file /tmp/record2


John Dvorchak
Honored Contributor

Re: cpio portability

When I do a man on cpio HPUX 10.20 I don't see the -v option although the rest look ok. I did notice some caveats and would suggest that you man cpio to see if any exist. For example, it can't handle files bigger than 2 gb and userids greater than 60k.
If it has wheels or a skirt, you can't afford it.
John Poff
Honored Contributor
Solution

Re: cpio portability

Hi again,

And if all that doesn't work, or if you can't get the tapes cut on the NCR box again, you might try downloading the GNU cpio. The GNU cpio should let you specify the block size as a multiple of 5120 byte blocks, so it might have a better chance of working.

JP
Carlos Fernandez Riera
Honored Contributor

Re: cpio portability

I cannot check it now, but use to follow this ways:

1- Copy the whole file to disk

dd if=/dev/rmt/xxx bs=51200 of=/tmp/cpio_file

now you cat try cat /tmp/cpio_file | cpio -itvc


2- dd if=/dev/rmt/xxx bs=51200 | cpio -itcv

3- man pax. pax is a portable tar and cpio compatible archiver. If i recall well there is a flag to change to buffer size.
unsupported
Jorge Prado_1
Advisor

Re: cpio portability

hello again,
when I try of reads the tape with the command:
# cpio -it and
# cpio -it B the system gives the following message:
# Out of phase--get help

thank you.


Carlos Fernandez Riera
Honored Contributor

Re: cpio portability

You need to change to block size, and hpux cpio only works with 512 bytes or 5K ( -B).


Note bs parameter is wrong, corret is ibs=51200
2- dd if=/dev/rmt/xxx ibs=51200 | cpio -itcv



unsupported
Frank Slootweg
Honored Contributor

Re: cpio portability

Please follow my earlier advice (and that of the others) and report back with the results.

As to the "Out of phase--get help" errors: What you did *cannot* work. You did not use the "c" (lower case "c")option on the read, while you did use it on the write. You should use it symmetrically, i.e. if (not) used on the write, then you should (not)use it on the read.

However adding "c" will not really help, because your main problem is probably the record/block size, which *probably* is 51200 bytes, while standard (i.e. also HP-UX) cpio uses 512 bytes (no "B" option) or 5120 (*not* 51200) bytes ("B" option).

What you can try (to list the tape) is:

dd if=/dev/rmt/0m ibs=51200 obs=5120 | cpio -icBvt