1834604 Members
3861 Online
110069 Solutions
New Discussion

View tape contents

 
SOLVED
Go to solution
karen_poon
Occasional Advisor

View tape contents

Is there a command to view the contents of a DDS3 Tape?
Thanks.
11 REPLIES 11
Andy Monks
Honored Contributor

Re: View tape contents

There are lots. It all depends on how it was saved :-

tar, cpio, fbackup, dump, vxdump, dd or omniback to name just a few.
Lasse Knudsen
Esteemed Contributor
Solution

Re: View tape contents

The immediate answer is dd if=/dev/rmt/0m , however this is not recommended (gives you probably a lot of garbage on the screen :-)

You need to know in what format the tape is written. The 2 most common formats are 'tar' and 'cpio'.

In order to produce a list of a 'tar' tape you would use tar tvf /dev/rmt/ and it would list the contents.

A list of a 'cpio' tape could be generated using a command similar to this one: cpio -itvB < /dev/rmt/

However tapes can be written in a lot of formats - so you really should know what kind of format it has been written in in the first place. Using the above commands will not do any harm and just gives an error if the tape format is not recognized.
In a world without fences - who needs Gates ?
James R. Ferguson
Acclaimed Contributor

Re: View tape contents

Hi:

# tar tvf /dev/rmt/0m

# cpio -ictv < /dev/rmt/0m

# frecover -vf /dev/rmt/0m -I /tmp/index

Note that tape device 0m is only used as an example. The frecover command verifies the tape and puts the index into a file caled /tmp/index .

...JRF...
augusto cossa
Frequent Advisor

Re: View tape contents

Poon,

Try:

mt -t /dev/rmt/0mn rew - This is to rewind tape

mt -t /dev/rmt/0mn fsf1 - this goes to first position

tar -vf /dev/rmt/0mn

Hope it's help

Thanks,

Augusto
augusto cossa
Frequent Advisor

Re: View tape contents

Poon,

Try:

mt -t /dev/rmt/0mn rew - This is to rewind tape

mt -t /dev/rmt/0mn fsf1 - this goes to first position

tar -tvf /dev/rmt/0mn

Hope it's help

Thanks,

Augusto
karen_poon
Occasional Advisor

Re: View tape contents

Thanks to all who reply. For I just realize I have no spare empty tape :( so I cannot try out those commands.

But I just need to confirm... ie if the tape is full, will it be auto ejected each time I insert into the tape drive?
Thanks again.


Carlos Fernandez Riera
Honored Contributor

Re: View tape contents

Carlos Fernandez Riera
Honored Contributor

Re: View tape contents


Is the drive eject/reject inserted tapes??

- Some drives reject newers tapes ie DDS2 drives dont accepts DDS3 tapes ( 125 m).

- Or drive may be break.



unsupported
CHRIS_ANORUO
Honored Contributor

Re: View tape contents

You can use the following:

# frecover -f /dev/rmt/0m -I-
# tar tvf /dev/rmt/0m
# cpio -ictv < /dev/rmt/0m

When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Andy Monks
Honored Contributor

Re: View tape contents

The tape doesn't know it full and therefore won't eject when you load it. All dds tapes rewind if you eject them.

Also, unless you position the tape yourself, it will always start at the beginning of the tape.

Btw, with fbackup, it always rewinds the tape before it starts so no point positioning the tape with that one
Kimathi Njeru
Advisor

Re: View tape contents

Poon,
To determine whether or not a tape was written to at all. (By whatever program)
Use the tcopy command.

tcopy /dev/rmt/0m

The output should be the no of files and/or block count.

Hope this helps.