Operating System - HP-UX
1831426 Members
3164 Online
110025 Solutions
New Discussion

how to display tape contents ?

 
SOLVED
Go to solution
vas  bolpali
Advisor

how to display tape contents ?

Hello,
1.How to show all of the files on the tape ?

2.How to show perticular type of files (*.tmp)
on the tape ?

3.How to extract the perticular type of file(s)
from tape to current/any directory?

Thnx in advance.
Vasu
keeping you ahead of the learning curve
6 REPLIES 6
Sachin Patel
Honored Contributor
Solution

Re: how to display tape contents ?

Hi Vasu,
If the data stored on tape using tar then to see contents
#tar tvf tapeaddress

if the data stored on tape using fbackup then use
#frecover -f tapeaddress -I file.index
file.index will be created in text format with listing of files

To recover files to original location:
# frecover -f /dev/rmt/0m -xov -i /source_directory

To recover files relative to the current working directory:
# cd /destination_directory
# frecover -f /dev/rmt/0m -xXov -i /source_directory

To recover all files under source directory to the present directory (all paths on tape will be ignored - leaving a flat directory structure):
# cd /destination_directory
# frecover -f /dev/rmt/0m -xFov -i /source_directory

If the data stored on tape using dump then use restore. I don't know which option to use but wait and someone will be with you.

Sachin
Is photography a hobby or another way to spend $
A. Clay Stephenson
Acclaimed Contributor

Re: how to display tape contents ?

Hi:

It would help to know the type of tape (tar,cpio,fbackup,OmniBack ...)

For tar:
tar vtf /dev/rmt0

for cpio:
cpio -ivt < /dev/rmt0

Things also get more complicated if reblocking is needed. More details, please.


man tar,cpio,fbackup for details.

Clay
If it ain't broke, I can fix that.
Praveen Bezawada
Respected Contributor

Re: how to display tape contents ?

Hi
It depends on the command that was used to make the tape in the first place.
Suppose if the tape was made with tar

tar -tv
displays the contents of the tape
tar -xv extracts the file
same way with cpio,fbackup

...BPK...
Victor_5
Trusted Contributor

Re: how to display tape contents ?

It depends on the command you are using.

fbackup/frecover
# verify backup and read the index file from the tape into a file called /tmp/index
frecover -vf /dev/rmt/0m -I /tmp/index
# list of what is really on the tape
frecover -rNv -f /dev/rmt/0m > /tmp/listing
However, it will cost more time

cpio
# verify what is on the tape
cpio -ictv < /dev/rmt/0m

tar
# verify contents of tape
tar tvf /dev/rmt/0m

However, if you don't know which command backup the tape, you can use

dd if=/dev/rmt/0m count=2 | od -Ad -tu > /tmp/tapelist

see the output.


linuxfan
Honored Contributor

Re: how to display tape contents ?

Hi Vasu,

You can use "pax" to restore files if they were archived using tar or cpio. pax can read both tar and cpio archives.

However if fbackup was used then you probably need to use "frecover".

Ofcourse its the easiest to restore if you know exactly what "tool" was used to create the archive in the first place.

-HTH
I am Ru
They think they know but don't. At least I know I don't know - Socrates
Bill Hassell
Honored Contributor

Re: how to display tape contents ?

One additional note. In Unix, there are NO file types (like .txt). On a PeeCEE, the type extension is added by most programs but it can be removed or renamed, thereby breaking some of the automatic features like double-clicking and launching the appropriate viewer.

In Unix, the files readme, README.TXT, READ.ME and ReAdMe.DOC.txt.EXE are all valid filenames and may contain any type of data. By convention, many people will add PC-like extensions but this is not a dependable way to identify a file's contents. So there is no connection between a file's name and the type of information inside the file.

That said, there is a guessing program called: file. If you type:

file myfile.DOC

it will try to guess what type of file it is based on a long list of magic numbers and magic strings. A list of these strings appears in the file (surprise) /etc/magic. There are lots of comments in that file concerning the format.

However, the file must exist so it can't be run to guess the contents of each file on a tape. You would have to restore the tape to a driectory and then type something like:

# cd /var/tmp/newfiles
# file *

and it will identify the files in the directory. You can also guess what the method of backup is for a tape with:

# file /dev/rmt/0m

Works pretty well but as I mentioned, these are guesses based on unique strings.


Bill Hassell, sysadmin