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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring from tape w/ cpio??

Status
Not open for further replies.

fmiller

IS-IT--Management
Oct 9, 2000
26
US
I'm attempting to restore a couple of directories to a server from a tape created on another system. So far I have been able to create a file listing all of the files on the tape so I know I am reading the tape OK. Now I'm trying to restore only the files that I need and it's not doing it.

I'm trying to restore all files in directories u, u2 and u3. I entered the command: cpio -icdv -I /dev/rct0 "/u?" .
After running for hours (24Gb tape), all I got was a listing on the screen:
/u2
/u3

No files restored, nothing else.

Trying it again, I put the system in maintenance mode first, then typed: cpio -icdv -I /dev/rct0 "/u?/*" . After running for a while, now I have a message saying: "unexpected trap in kernal mode, PANIC: k_trap - kernal mode trap type 0x0000000E." Have I boggled the system completely, or is there something else going on here?
 
Hi,

I'm not sure if I'm interpreting this correctly, but rather than /u?, perhaps you should be using /u*

Try:

cpio -icdv &quot;u*&quot; < /dev/rct0

from wherever you are restoring the files to.

Be careful, however, because this will also pick up any other files beginning with u - unix for example, if it exists on the tape.

I don't think the system will be boggled, it's just got a bit confused!

Good luck.
 
Sorry, the command should probably be:

cpio -icdv &quot;/u*&quot; < /dev/rct0

Regards.
 
I restarted the server last night after I realized it wasn't responding to anything after the panic message. I tried it again using cpio -icdv -I /dev/rct0 &quot;/u?/*&quot; . I see this morning that this time it did restore the /u2 directory, but not the /u. Looks like cpio does not expand meta-characters the way I expected. I always thought that the ? meta-character indicated zero or one character. Apparently, cpio expands the ? to only mean one character.
 
As I understand it, the ? matches any single character in the name of an existing file.

As an example, if you create files called mem, memo, memo1 and memo2 and then do an ls memo? on the directory, only memo1 and memo2 are listed (this example taken from Mark G Sobell's 'A Practical Guide To The Unix System).

Hope you've solved your problem!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top