Unix administration - How to read files stored in tape drive?

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > September 2006 > How to read files stored in tape drive?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to read files stored in tape drive?
wubin_98@yahoo.com

2006-09-16, 1:43 pm

Hi there,

I am a newbee of unix. I am under HP-UX and want to copy files from hp
tape drive to server.
The tape drive has already be correctly installed and verified by using

mt -t /dev/rmt/0m offl
to eject the tape.

My question is : Where can I find a list of the files on the tape so
that I can copy them to server?

Thanks in advance.

Ben

Tim Skirvin

2006-09-16, 1:43 pm

wubin_98@yahoo.com writes:

> My question is : Where can I find a list of the files on the tape so
> that I can copy them to server?


It's not that simple. You need to know what application wrote the
files to the tape in the first place; you'll need something similar to
retrieve the files. You'll also need to know whether you used the
compressed tape device or the uncompressed one. And if you don't know,
you'll need to find out before anyone can help you.

(If the backups were done with a commercial package, I hope you
still have a license sitting around somewhere.)

- Tim Skirvin (tskirvin@ks.uiuc.edu)
--
Theoretical and Computational http://www.ks.uiuc.edu/~tskirvin/
Biophysics, Beckman Institute, UIUC Senior Systems Administrator
wubin_98@yahoo.com

2006-09-16, 1:43 pm

Thank you for the reply.

I'm using HP C1533A tape drive. I am not sure whether it is a
compressed tape device or the uncompressed one. What stored in the tape
is just testing data from customer instead of backups.

In my case, is it correct to use 'tar /dev/rmt/1m' to retrive the data?

Thanks.

Ben


Tim Skirvin wrote:
> wubin_98@yahoo.com writes:
>
>
> It's not that simple. You need to know what application wrote the
> files to the tape in the first place; you'll need something similar to
> retrieve the files. You'll also need to know whether you used the
> compressed tape device or the uncompressed one. And if you don't know,
> you'll need to find out before anyone can help you.
>
> (If the backups were done with a commercial package, I hope you
> still have a license sitting around somewhere.)
>
> - Tim Skirvin (tskirvin@ks.uiuc.edu)
> --
> Theoretical and Computational http://www.ks.uiuc.edu/~tskirvin/
> Biophysics, Beckman Institute, UIUC Senior Systems Administrator


Tim Skirvin

2006-09-16, 1:43 pm

wubin_98@yahoo.com writes:

[top-posting fixed]
[vbcol=seagreen]
[vbcol=seagreen]
> I'm using HP C1533A tape drive. I am not sure whether it is a
> compressed tape device or the uncompressed one. What stored in the tape
> is just testing data from customer instead of backups.


Okay, but how was it written to the drive?

> In my case, is it correct to use 'tar /dev/rmt/1m' to retrive the data?


Maybe. The 'm' is the medium-level of compression; but there are
are other levels. (I only use the 'c' level myself, if anything.) You
may need to experiment.

'man mtio' may help.

- Tim Skirvin (tskirvin@ks.uiuc.edu)
--
Theoretical and Computational http://www.ks.uiuc.edu/~tskirvin/
Biophysics, Beckman Institute, UIUC Senior Systems Administrator
Chris Mattern

2006-09-16, 1:43 pm

wubin_98@yahoo.com wrote:
> Hi there,
>
> I am a newbee of unix. I am under HP-UX and want to copy files from hp
> tape drive to server.
> The tape drive has already be correctly installed and verified by using
>
> mt -t /dev/rmt/0m offl
> to eject the tape.
>
> My question is : Where can I find a list of the files on the tape so
> that I can copy them to server?
>


File on tape don't have names. You just start reading the tape.
Each new file on the tape will be demarked by a filemark. The
end of data on the tape will be demarked by two filemarks. You
can use mt to forward space and backward space over the filemarks.
Also remember that you need to use the non-rewinding tape drive
device file in order to maintain your position on the tape.


--
Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
Chris Mattern

2006-09-16, 1:43 pm

wubin_98@yahoo.com wrote:
> Thank you for the reply.
>
> I'm using HP C1533A tape drive. I am not sure whether it is a
> compressed tape device or the uncompressed one. What stored in the tape
> is just testing data from customer instead of backups.
>
> In my case, is it correct to use 'tar /dev/rmt/1m' to retrive the data?
>


No, because that's not how you specify a source file in tar. Read
tar's manpage. Using tar in the first place is correct if the
customer used tar to create the tape file. If they didn't, you
need to use something else.


--
Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
Doug Freyburger

2006-09-16, 1:43 pm

wubin_98@yahoo.com wrote:
>
> I am a newbee of unix ...
>
> My question is : Where can I find a list of the files on the tape so
> that I can copy them to server?


Unfortunately tape support on UNIX is poor enough that this
isn't a job for newbies. The general method is to give it to
your sysadmin.

The problem is you'll need to know the density to be able
to tell what device to use under /dev/rmt/0*. Then you'll
need to know what format the data is in. Then you'll need
to know the command line switches for that command.
For that matter, you'll also need to check if there are more
than one files on that tape.

To find the density I like to use tcopy if it is on your system
or if not dd. Something like this:

for i in /dev/rmt/0* ; do
echo $i
mt -f $i rewind
tcopy $i
mt -f $i rewind
sleep 1
done

Or

for i in /dev/rmt/0* ; do
echo $i
mt -f $i rewind
dd if=${i} of=/dev/null
mt -f $i rewind
sleep 1
done

The rewind's aren't as redundant as they look, not quite anways.

tcopy gives the blocksizes and number of blocks on the tape,
one of the best tape inspection tools around if it's installed on
your system.

dd says the tape is 0 length if the density is wrong, because
data in the wrong density doesn't read.

How to tell what format it's in once you know the format, that's
another topic.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com