Operating System - HP-UX
1824806 Members
4101 Online
109674 Solutions
New Discussion юеВ

Re: problem restoring files from CPIO

 
SOLVED
Go to solution
Tony Kuehn
Advisor

problem restoring files from CPIO

Hi,
I have a DLT tape that has a CPIO archive on it that was created on a AIX machine. I need to recover a few of the files, however, I don't have a AIX machine (yet) to recover to. The problem is that the CPIO command used to write the files uses an option specific to AIX that is not available to HPUX. Here is the command that is used to create the archive:
find $directory -print | cpio -C300ov > $Tape

On HPUX, I cannot find an equivalent option for the -C. I have tried using PAX to restore the files and I am able to get the first file (or part of it from tape) and then I get a message to enter the second volume. Here is the pax command that I am using:
pax -r -x cpio -b 300 -f $tape -v '/string/'

I have tried using the no-rewind device file for the tape and then using mt -t fsf 1 to move the tape forward one file and tried the pax command again but that gives me the following error message:
pax: [offset 0g+0m+0k+0]: I/O error

Please advise, any help/suggestions you may have to get the other files recovered from the tape, cpio, pax, or other.

Thank you!
Tony
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: problem restoring files from CPIO

I don't see how pax is going to recover files written by AIX cpio.

You must use cpio.

I don't update cpio very often. You may find the feature you need in the latest patch that includes cpio or from a version at the software archive site.

http://hpux.connect.org.uk/hppd/hpux/Gnu/cpio-2.5/

http://www2.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main|patch.breadcrumb.search|&patchid=PHCO_24440&context=hpux:800:11:11

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
H.Merijn Brand (procura
Honored Contributor
Solution

Re: problem restoring files from CPIO

I have both :)

# dd if=/dev/rmt/0m ibs=10240k | cpio -ivdm

-Cblocks is the alternative for -B

GNU cpio supports both, which makes it the best bet for you

Most recent cpio (less than two weeks) were uploaded to my site:

http://mirrors.develooper.com/hpux/#Downloads
10.20: http://mirrors.develooper.com/hpux/cpio-2.6-pa1.1
11.00: http://mirrors.develooper.com/hpux/cpio-2.6-pa2.0
11.11: http://mirrors.develooper.com/hpux/cpio-2.6-elf64

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Etienne Roseau
Frequent Advisor

Re: problem restoring files from CPIO

hi, on HPUX version of cpio, the line command to restore files from a tape is :
cpio -icvdBmu < /dev/rmt/Xm
to exec in the dir where you want the files to be restored
HTH
E.
ps happy new year 'verybody
H.Merijn Brand (procura
Honored Contributor

Re: problem restoring files from CPIO

Etienne, that is a very dangerous combination of options for a tape coming from another system!

-u = UNCONDITIONALY

cpio allows absolute pathnames, what if I gave you this archive, created on a trusted AIX system?

# echo /etc/passwd | cpio -ocvB >/dev/rmt0

Do you think your HP-UX system will still work after extractiong the tape? I bet next time you will think again ...


Enjoy, Have (safe) FUN! H.merijn
Enjoy, Have FUN! H.Merijn
Tony Kuehn
Advisor

Re: problem restoring files from CPIO

Thank you for your replies. I tried the CPIO command that was suggested by Procura and that is working! Thank you all for your assistance.

Tony
Tony Kuehn
Advisor

Re: problem restoring files from CPIO

Thanks again for all the replies.