Operating System - Linux
1827800 Members
2260 Online
109969 Solutions
New Discussion

Re: CPIO - Extracting From DDS2

 
SOLVED
Go to solution
William Carty
New Member

CPIO - Extracting From DDS2

Hi,

I know very little about cpio, have always used tar to create archives.

I've been given a DDS2 tape which contains 4 directories full of tif images (around 400 images total). I'm trying to extract those images from tape to the local hard drive using cpio. Unfortunately, I don't have access to the machine that created the archive - it is my understanding that it was created on an HP-UX box using cpio. I'm running RedHat 6.2 on the machine I want to extract the data to.

I've been able to read the tape & generate a list of the directories / files using "cpio -itvB < /dev/nst0 > /tmp/images/index". That command produces output as follows:

-rw------- 1 304 24 20987 Oct 16 08:53 LR30/LR200000151000101_001.tif
-rw------- 1 304 24 37085 Oct 16 08:53 LR30/LR200000151000101_002.tif
-rw------- 1 304 24 69440 Oct 16 08:53 LR30/LR200000151000101_003.tif
-rw------- 1 304 24 73582 Oct 16 08:53 LR30/LR200000151000101_004.tif
-rw------- 1 304 24 68438 Oct 16 08:53 LR30/LR200000151000101_005.tif
-rw------- 1 304 24 76456 Oct 16 08:53 LR30/LR200000151000101_006.tif
-rw------- 1 304 24 57100 Oct 16 08:53 LR30/LR200000151000101_007.tif
-rw------- 1 304 24 28259 Oct 16 08:53 LR30/LR200000151000101_008.tif

My main question is how exactly am I supposed to go about extracting these files??

I did the following:

[root@tape tmp]# cpio -ivBum /LR30/LR200000151000101_001.tif < /dev/st0
85313 blocks

Which, seems to me, completed sucsesfully. However, I can't seem to find the extracted image anywhere!

I've been working on this for three days now & have overcome many other problems. I feel like I've finally got it working, if I can just figure out where this stuff is being extracted to...

"locate *.tif" doesn't find the file.

Thanks for any suggestions.
6 REPLIES 6
William Carty
New Member

Re: CPIO - Extracting From DDS2

Just to clarify - the post shows one command with /dev/nst0 & one with /dev/st0. That should be /dev/nst0 (however, I have tried the commands with both devices).
Ted Ellis_2
Honored Contributor

Re: CPIO - Extracting From DDS2

first thing I notice is that the preview (-t option) listing shows all of the files missing the leading / in the file name...

try and run your import command as you have written, but take off the leading / on the file you are importing... and run this command in a location that you are sure will have enough space for the file. Without the leading /, the restore will place the file under the directory where you are sitting when the command is run. It looks like the backups may have been created while ignoring the leading /, or were relative path by design. See if that works

Ted
William Carty
New Member

Re: CPIO - Extracting From DDS2

Hi Ted, thanks for your response.

When I leave off the slash, here is what I get:

[root@tape tmp]# cpio -ivBum LR30/LR200000151000101_001.tif < /dev/nst0
cpio: LR30/LR200000151000101_001.tif: No such file or directory

In fact, I get that for any of the files listed in the preview.

So far, the *only* way I've gotten cpio to run without returning an error of some kind is by using the script I mentioned in my original post.

When I started out, I thought that "cpio -itv
I wonder if this has anything to do with block size? I've tried setting various block sizes via "mt -f /dev/st0 setblk", but none of them have made a difference.

Thanks.
Ted Ellis_2
Honored Contributor

Re: CPIO - Extracting From DDS2

try and disable the default block size:

mt -f /dev/st0 defblksize -1

you may also try and set the block size on the drive to variable.. I think that is done with:

mt -f /dev/st0 setblk 0

mt -f /dev/st0 status will list the drive status

Ted

Darrell Allen
Honored Contributor
Solution

Re: CPIO - Extracting From DDS2

Hi,

I've not used cpio in awhile but this should work:
cpio -ivdBum LR30/LR200000151000101_001.tif
That assumes you've rewound your tape to the start of the cpio archive.

The "d" in "-ivdBum" should create direcroty "LR30" sub-ordinate to your current directory.

To specify which files to extract, use a "pattern" after the "-ivdBum" options. The default pattern is * for all files. For all .tif files you show above, you could use *.tif as your pattern.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
William Carty
New Member

Re: CPIO - Extracting From DDS2

To Darrell -

Thanks a bunch! The -ivdBum switch worked like a charm. I'm rolling in tif's now!! :)

Thanks again!