Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CPIO does not work... Please help!

Status
Not open for further replies.

Rosti

Programmer
Mar 5, 2002
46
US
Greetings.
I am using this command to put our backup data to tape device:
cpio -ovcumdBa </mnt5/backuplist.par >$outputdevice

When I wont to bring the data back from the tape, I am using this command:
cpio -ivcmdluB </dev/rmt/0m usr/dcr/star/file.name

It looks that is does something during execution of this command, but then when it finishes, I cannot see any files!
It worked about a half year ago. Now it does not!
What it can be?
Thanks in advance!
 
When you output to a device (cpio -o) you need to use the (>) and not the input (<).
 
As you may see I am using (>) for outputing to device! Now, I need to bring the data back from the tape!
 
1. Are you sure the tape is rewound? Try mt -f /dev/rmt/0m rewind before the cpio.

2. Are you sure the file you're after is on the tape - the -v option to cpio should indicate whether it's found it.

3. Having rewound the tape, try a cpio -itv < /dev/rmt/0m to see (but not write) a table of contents. Are these absolute (ie, preceded with /) or relative (preceded with ./).

4. I'm getting a feeling of deja-vu - see similar thread in SCO unix forum!
 
Hello KenCunningham!
That is right - I have posted the same question on another post too.
The tape is rewinded, and I have checked all the staff you suggesting! The tape is rewinded and the file is there.
When I used "cpio -itv < /dev/rmt/0m to see (but not write) a table of contents" - it gave me an "Out of phas; resyncing. cpio: Re-synced after skipping 6529 bytes... " messages. Then this message was repeating but with different amount of bytes.
Do you have any idea what could it be?
Thanks.
 
Hi Rosti. This is from the HP cpio man page:

"DIAGNOSTICS
The diagnostic message Out of phase indicates that cpio could not successfully read its particular ``magic number'' in the header. Without the R option specified, cpio fails and returns an exit code of 2. With the R option, cpio attempts to resync automatically (resyncing means that cpio tries to find the next good header in the archive and continues processing from there). If cpio tries to resynchronize from being ``Out of phase'', it returns an exit code of 1. If resynchronization fails, try changing header mode (-c option) or byte swapping the header (-P or -s options)."

I don't know whether this means an awful lot to you, but suggest you look at the man page for the -c, -P and -s options in case they might help you. Incidentally, is the $outputdevice mentioned in your first post the same as the /dev/rmt/0m device in the restore? If not, I suggest you make it so that you're using the restore with the same device exactly - the 0m specifes medium density, are you certain it isn't normal (/dev/rmt/0) or compressed (/dev/rmt/0c). You could try both! Good luck.
 
were the tape contents compressed during the cpio process ?
Try this to read the tape contents -
uncompress < /dev/rmt/0 | cpio –itcv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top