ITEM: DP7381L

cpio behaves oddly.



Question:

4.1.3

Model 25T

Need asst. with cpio 

Response:

Customer Contact

Response:

 ENV:    4.1.3, model 25T

 CUSTOMER REP:

 PROBLEM:    When running this command:
 \# find . -cpio -ov > /dev/rmt0.1 -print

 "0652-028 cannot write output."

 ACTION TAKEN:    I think the problem is with the syntax.  The -cpio
flag of the find command should be of the format:
 -cpio Device
 So I had him try it this way:
 \# find . -print -cpio /dev/rmt0 >
 \# tctl rewind
 \# cpio -itv \< /dev/rmt0
 It didn't work.  This is probably because find -cpio uses a cpio block size
other than the default.  We should be able to read it with pax.
 \# pax -vf /dev/rmt0
 This worked.

 He wants to do it by redirecting the output of find to cpio.  I told
him to try this:
 \# find . -print | cpio -ov /dev/rmt0
 "find 0652-017 ov is not a valid option."
 Oops.  That  should be a | and there should be a  before the device.
 \# find . -print | cpio -ov  /dev/rmt0
 "ksh: /dev/rmt0: 0403-005 cannot create the specified file."
 \# tctl -f /dev/rmt0 status
 Tried the cpio again:
 It backed up a few files and then returned an error:
 "cpio 0511-038 cannot write to the specified output."
 "cpio: a system call received a parameter that is not valid.  Enter
the device or filename when ready to continue."

 Let's try changing the block_size to 0 and specifying -C2 in the
cpio.
 \# chdev -l rmt0 -a block_size=0
 "rmt0 changed."
 \# find . -print | cpio -ovC2 > /dev/rmt0
 This worked.  He thinks that someone changed the block_size from 0 to
1024, and that's what caused his scripts to stop working correctly.

 His email address is bochnakt@avereydennison.com

 ACTION PLAN:    CWCA.

 TEST CASE:    N/A.

0652-028 cannot write output.

Response:

Closing with Customer Approval

Response:

 CUSTOMER REP:    N/A.

 ACTION TAKEN:    I did some testing and I discovered that cpio and
find -cpio behave a littel bit differently.

 TESTCASE:
 \# chdev -l rmt0 -a block_size=0
 \# cd /var
 (any directory will do... /var is small: good for testing)

 \# find . -print | cpio -ov > /dev/rmt0
 \# dd if=/dev/rmt0 bs=128k count=1 2>/dev/null | wc -c
 "512"

 \# find . -print -cpio /dev/rmt0
 \# dd if=/dev/rmt0 bs=128k count=1 2>/dev/null | wc -c
 "5120"

 So cpio defaults to a block size of 512, but find with the -cpio flag
uses a block size of 5120, or 5K.  This means that it's acting like
it's using a -C10 flag.  It would be necessary to specify the -C10
flag to read a cpio archive written using find -cpio:
 \# cpio -itvC10 \< /dev/rmt0
 ( I checked, and this works.)

 ACTION PLAN:    CWCA.

Response:

Closing with Customer Approval


Support Line: cpio behaves oddly. ITEM: DP7381L
Dated: September 1997 Category: N/A
This HTML file was generated 99/06/24~13:30:15
Comments or suggestions? Contact us