LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-17-2003, 09:41 AM   #1
Rig24
LQ Newbie
 
Registered: Dec 2002
Location: McLean
Posts: 28

Rep: Reputation: 15
Tar command


I am trying to back up some directories on my Red Hat 7.3 system and am having trouble with the tar command. The tap device is /dev/st0 and I am tring to backup the /export/home directory. I also need to be able to set it not to rewind, that is where I am having the problem. The command I am using is:

tar cvf /dev/nrst0 /export/home

If I dont use the "nr" it workd fine, but overwrites whatever is on the tape.

Thanks for any help

Rob
 
Old 04-17-2003, 09:55 AM   #2
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
the command you need is "mt"

mt -f /dev/nrst0 rewind ---> rewind tape
mt -f /dev/nrst0 rewoffl ---> rewind & eject tape
mt -f /dev/nrst0 fsf ---> skip a file
etc.

any time you use the /dev/nrst0 (no-rewind) device, the tape stays at the end of the current read/write when the device is closed (e.g. by tar), whenever you use /dev/st0 the device rewinds on close and you are back on the beginning of the tape.
 
Old 04-18-2003, 05:47 AM   #3
Rig24
LQ Newbie
 
Registered: Dec 2002
Location: McLean
Posts: 28

Original Poster
Rep: Reputation: 15
The /dev/nrst0 doesn't work, I can only get the /dev/st0 to work. and then the tape rewinds and the next day it gets overwriten. I looked at the man pages of the "mt" command and I didn't see how to move the position to the end of the tape so the next tar would append to the tape and not overwrite. Sorry, I very new with Linux, still trying to grasp things.
 
Old 04-18-2003, 09:59 AM   #4
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
probably "/dev/nrst0" should be "/dev/nst0"

give it a try
 
Old 04-18-2003, 12:32 PM   #5
Rig24
LQ Newbie
 
Registered: Dec 2002
Location: McLean
Posts: 28

Original Poster
Rep: Reputation: 15
still having problems. when I give the "/dev/nrst0" command all I get is a listing of the directory I am tring to write to tape. I noticed that "st0" and "nrst0" have different attributes:
st0 = crw-rw----
nrst0 = -rw-r--r--
So I am guessing that "nrst0" needs to change somewhat?
 
Old 04-18-2003, 08:47 PM   #6
AltF4
Member
 
Registered: Sep 2002
Location: .at
Distribution: SuSE, Knoppix
Posts: 532

Rep: Reputation: 31
your "/dev/nrst0" is a plain file, you need a "device file"

use "/dev/nst0" instead of "/dev/nrst0"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
Tar command juanb Linux - General 4 11-03-2005 12:10 AM
tar command? xmdms Linux - General 4 10-07-2004 01:29 PM
tar command.. johnyy Linux - Software 4 12-31-2003 10:54 PM
Tar command satimis Linux - Newbie 3 11-03-2003 10:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration