Re: cpio view only

 
SOLVED
Go to solution
Jade Bulante
Frequent Advisor

cpio view only

I would like to find out if there's a way to view the contents of a DLT tape using the cpio command.

The path I'm using is /dev/rmt/6mb.

Please advice.
5 REPLIES 5
fg_1
Trusted Contributor
Solution

Re: cpio view only

I believe that you can use tar to also view the contents.

tar -tvf /dev/rmt/6mb > /tmp/(outputfile)

Gl

Frank G.
H.Merijn Brand (procura
Honored Contributor

Re: cpio view only

cpio -itv
if it complaints, try

cpio -itvc
if it still complaints, try prepending either command with dd

dd if=/dev/rmt/6mb ibs=204800 | cpio ...

best is to use dd in combination with GNU cpio, which does do the -c detection on read automatically. GNU cpio is available from my ITRC site: http://www.cmve.net/~merijn or https://www.beepz.com/personal/merijn

Enjoy, have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Jeff Schussele
Honored Contributor

Re: cpio view only

Hi Jade,

This will work only if the tape was created using cpio:

cpio -itv < /dev/rmt/6mb

This will only list the contents - not extract them. And you'll probably want to redirect to a file

cpio -itv < /dev/rmt/6mb > /tmp/tape.out

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rick Garland
Honored Contributor

Re: cpio view only

The key option for the your question is the "t" - table of contents.

This would also apply for tar
tar -tvf ...


Could also use pax
Robert-Jan Goossens
Honored Contributor

Re: cpio view only

Hi

Using cpio to list the entries in a file archive on a tape device:

# cpio -itcvB < /dev/rmt/6mb

Robert-Jan.