LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Tar command (https://www.linuxquestions.org/questions/linux-general-1/tar-command-55508/)

Rig24 04-17-2003 09:41 AM

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

AltF4 04-17-2003 09:55 AM

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.

Rig24 04-18-2003 05:47 AM

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.

AltF4 04-18-2003 09:59 AM

probably "/dev/nrst0" should be "/dev/nst0"

give it a try

Rig24 04-18-2003 12:32 PM

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?

AltF4 04-18-2003 08:47 PM

your "/dev/nrst0" is a plain file, you need a "device file"

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


All times are GMT -5. The time now is 07:27 AM.