1832617 Members
3242 Online
110043 Solutions
New Discussion

tar doubt

 
SOLVED
Go to solution
M.Thomas
Frequent Advisor

tar doubt

suppose i have a tape attached (std /dev/rmt/0m) and i want to restore the contents of the tape to /restore/data..what command would exactly put the data from the tape to the disk in that directory path?

Thanks

Thomas
4 REPLIES 4
Steven Schweda
Honored Contributor

Re: tar doubt

The answer might depend on how the tape was
created. Some output from:
tar tvf /dev/rmt/0m
might be helpful in deciding.

If there are no absolute paths in the "tar"
file on the tape, then it should be good
enough to:
cd /restore/data
tar x....f /dev/rmt/0m
where "...." depends on your needs and/or
preferences. ("man tar".)
M.Thomas
Frequent Advisor

Re: tar doubt

Thanks. what if there is an absolute path name? Also this /restore/data if this is not a filesystem would fill up root correct? the data size seems to be 100G.

Thanks

Thomas
Yang Qin_1
Honored Contributor

Re: tar doubt

Hi, it is better to run "tar -tfv /dev/rmt/0m" to list exactly how those files stored on tape /restore/date or restore/data. If you are not sure about the path you may have problem on the system as there 100 GB on the tape.

If it is /restore/data/ then you need to create a new file system /restore with 100 GB.

If it is restore/data then you can restore the file in a file system where you can have 100 GB.

If you cannot find 100 GB on your system you can consider restore files part by part

tar xfv /dev/rmt/0m /restore/data/files1*

then move files to another location restore sencond part

tar xfv /dev/rmt/0m /restore/data/file2*

To do this, you need to list the content on the tape with "tar tfv .."


Yang
Steven Schweda
Honored Contributor
Solution

Re: tar doubt

An absolute name begins with "/".

If you're in "/restore/data" and the "tar"
file says "abc/def", a relative path, then
you normally get "/restore/data/abc/def".
If the "tar" file says "/abc/def", an
absolute path, then you normally get
"/abc/def" (no matter where you are).

Different "tar" and/or similar programs
("pax") may offer ways to get files with
absolute paths restored in other places, but
that's the normal behavior.

> Also this /restore/data if this is not a
> filesystem would fill up root correct?

If "/restore" does not aready exist,then it's
hard to do the "cd /restore/data" step. If
you simply do:
mkdir -p /restore/data
then, yes, it will be created in the root
file system ("/").

> the data size seems to be 100G.

So you had better have (or create) a file
system with 100GB of free space, and put the
data there. You're the one who said that you
wanted them to go into "/restore/data". I
assumed that that was a suitable place.