# List Contents



## Gideon (Aug 21, 2010)

Any Help apreciated...

I have an external SCSI Tape backup drive.

How do I list the contents of a tape in the drive?

THanks


----------



## adamk (Aug 21, 2010)

It all depends on how the contents were written to the tape in the first place.  If tar was used, you could use tar again...  `tar tvf /dev/mt0`


----------



## wblock@ (Aug 21, 2010)

A tape drive is like one big file.  So listing the contents is like listing the contents of an archive file: you feed the data from the tape drive device into the archiving program that was used, and tell it to list the contents.

If the tape was written with tar:
`# tar tvf /dev/sa0`

A tape can actually hold more than one file, with index marks between them, and the sa(4) device rewinds the tape when the device is closed.  So in the example above, you'll only see the listing of the first section of the tape.  You can use mt(1) to move between index marks, but you also have to use the non-rewind version of the sa device, "/dev/nsa0", to prevent rewinding.


----------



## adamk (Aug 21, 2010)

D'oh, my apologies.   wblock has the correct device ( /dev/da0 ).  Sorry about that.  Not sure where /dev/mt0 came from.

Adam


----------



## Gideon (Sep 2, 2010)

The tape was made using the backup command i believe?  I have been able to list the contents with:

`restore -t -f /dev/sa0 -s 1 /location/location/ etc`

However, I also would like to be able to see the dates on the files?  Is that possible?

Thanks for the help!


----------



## SirDice (Sep 2, 2010)

Try the -i (interactive) option for restore.

See restore(8).


----------

