The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-05-2005
FredSmith FredSmith is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 88
Help with TAR

Hi,
I tarred some files off to a tape. I'm trying to restore them now.
Am I missing a step?

1) I rewind the tape.
2) I did a tar -tvf and saw the file on the tape.
3) I do a tar -xvf <file_name> that was shown from the tar -tvf

Is this all I need to do to restore the file? Just trying to make sure I have the command right before issuing it, the file is very very large.

Thanks!
  #2 (permalink)  
Old 12-05-2005
BOFH BOFH is offline Forum Advisor  
Registered User
  
 

Join Date: Feb 2005
Location: Broomfield, CO
Posts: 406
<filename> is the device you're restoring data from when you supply the 'f' switch. The default device is /dev/rmt/0 on sun, /dev/sa0 on OS X, and /dev/rmt0 on linux so if you remove the 'f' parameter, the command would extract from the default device and would look like:

tar vx [filename]

If it's a different device

tar xvf [device] [filename]

Carl
  #3 (permalink)  
Old 12-06-2005
Gary Hannon Gary Hannon is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 1
Some more tar parameters

You may also want to pay attention to some other parameters of tar. You must include one of these actions:

x=Extract contents
t=List contents
c=Create

Then there is the:
v=verbose which echos the results to the standard output (screen)

If if you specify:
f=file If "f" is specified, the next parameter must be the device or file of the archive. If no "f" is specified, the default device ( sometimes specified in /etc/defaults/tar ) will be used.

So tar -xvf <file> <path/files> or -cvf <file> <path/files> or tar -tvf <file> are the most common.

You may also want to pay attention to the file attributes and how to handle duplicates and paths that do not exist. Each OS may have minor differences so read the man page for that OS.
  #4 (permalink)  
Old 12-07-2005
FredSmith FredSmith is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 88
RE: Help with TAR

I have a bunch of tar'red files on a tape.

I'm trying to restore them to disk.

I've read the MAN pages and some googled sites, but I'm still confused:

I run the tar -xvf /dev/rmt/2un <file_name>
command and it restores the files.

But, how do I know which tar file is next on the tape? If I do a tar -tvf, it is past the point on the tape of the file right? Is there any way to do a tar -tvf and then rewind JUST 1 TAR file back so that I can then restore it?

Thanks!
  #5 (permalink)  
Old 12-07-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
You know what's on the tape because you are the guy who wrote stuff to the tape. When that does not work, I take one pass though the tape mapping it out, then I rewind it and restore on the second pass. There are commands like "mt bsf 2", but I don't think it's worth it.
  #6 (permalink)  
Old 12-08-2005
FredSmith FredSmith is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 88
I know what's on the tape, I just don't know the order of what's on the tape unfortunately

When you say you take a pass through the tape "mapping" out what's on the tape, do you mean you just do repetitive tar -tvf commands?

Thanks for the help!
  #7 (permalink)  
Old 12-08-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,100
Quote:
Originally Posted by FredSmith
When you say you take a pass through the tape "mapping" out what's on the tape, do you mean you just do repetitive tar -tvf commands?
AHA! A trick question! Only if the tape is in tar format.
Sponsored Links
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0