CPIO listing from tape question...

Hi.

I have this old server onto which i needed to list the content of a tape. This is a SCO box (SCO_SV 3.2 5.0.6 i386) and backup was done using cpio.

#tape status
     status : ready beginning-of-tape
soft errors : 0
hard errors : 0
  underruns : 0

#dtype /dev/rct0
/dev/rct0       : cpio old character format

#cpio -ivt < /dev/rct0
1 blocks

I am not familiar with cpio and sco...but I remember doing a restore waaaayyyyy long ago and these are the commands i used to prep and list the content

If i remembered correctly, the cpio -ivt would "list" the tape content. But all i get is the "1 blocks" answer...

Is it, because there is nothing on the tape? Any other way i can "list" the content?

Thanks folks!

Please post the script which was used to create the tape.

We are particularly interested in whether the "no rewind" device was used on output in which case you would need to use the unix mt command to advance partition-by-partition along the tape. Also whether the block size parameters and/or ASCII headers options were used because the same parameters are required on data retrieval.

I think that we can safely say that the first tape partition is empty, or contains something not recognisable as a unix filesystem, or was written with special parameters.
BTW. In those days we used to pipe cpio to dd to get some speed and this created a raw tape partition.

Tip: If you have a blank tape available, practice the commands on a blank tape and keep an eye on the device directory to make sure that you actually write to the tape drive and not to a file. Try some basic mt commands to make sure that the tape moves.

Footnote: By old you mean really old (i386 !). What is the hardware? I wouldn't risk loading any critical data tapes until you are 100% sure of the commands because you may only have one go at this.

1 Like

Well it's been a few years since I was deep into SCO Unix but here are my thoughts on this.

FIRSTLY, write protect your cartridge, DAT or whatever to avoid any accidents!!!

As Methyl comments do you have the script/utility that wrote the tape? Many utilities did their own thing and created "headers" and stuff on the front of tapes.

I seem to remember that on SCO

 
cpio -ivt < /dev/rct0

did not behave the same as

 
cpio -ivt -I /dev/rct0

Crazy but I think that's true.

Basically, you are right that the switches -ivt should list the tape. The tape might have been written using the -c switch and/or the -B switch but I also seem to remember that cpio could figure that out for itself on a restore.

As Methyl suggests try a no-rewind device several times over and see what happens.

I suggest that you try all these:-

 
cpio -ivt -I /dev/rct0
cpio -ivt -I /dev/nrct0  (repeat this command several times)
cpio -ivtcB -I /dev/rct0
cpio -ivtcB -I /dev/nrct0  (repeated several times)

You are sure that the tape isn't tar format???

1 Like

Thank you for the input. After some trial and error, finally got it to work. don't know why it is behaving that way, but ran command once, did not work, but after retrying it worked? Maybe just a "timing" issue...not being patient and waiting for the data to be displayed?

I took notes of the commands you've provided and will keep them in mind for my next "old" server needs...Yep, i386 are pretty darn old :slight_smile: But, they work flawlessly...The hardware are actually IBM 1U servers. Can't remember the model exactly (x336 i think?)

You never said what tape drive or brand, but some DAT drives have a header partition that you have to bypass. So the first attempt reads the header without rewinding, then the second attempt gets the data.

@Stephan
Please post the command which worked (when typed twice).