Note: This is not related to networking at all, I cc: the tape list.

On Tue, 8 Dec 1998, tim hibbard wrote:

>   I have RedHat 5.1, and a HP scsi SureStore 6000.  I want to be able to do
> multiple backups on one tape.  Here is what I have tried to date, and if
> someonecould point out my errors
> 

Note: /dev/st0 is the rewinding tape device. Whenever it is closed by an
application, an EOF mark is written and the tape is rewound. For what you
want to do here, you must use the non rewinding tape device. Usually it
should be called /dev/nst0 ! It does not write additional EOF marks and
does not move the tape on closing.

> mt -f /dev/st0 rewind #Rewind the tape to beg
This is ok.

> bru -cvf /dev/st0 /root #Backup Root Partion
Ok, but: bru will probably write an EOF mark, and when /dev/st0 is closed
another one is written and tape is rewound.

> mt -f /dev/st0 fsf 1  #This should position me at the next marker?

This will probably bring you between the two EOF marks just written. Many
(old) tapes will refuse to write anywhere else than beginning of tape or
end of data. Then, /dev/st0 is closed and rewound.

For such things, consider using 'mt -f /dev/nst0 seod' or
'mt -f /dev/nst0 eod' for search end of data. In general use the
non rewinding device for mt as not to have the kernel reposition the tape
on closing the tape device which was opened by mt.

> bru -cvf /dev/st0 /etc        #back up /etc
This overwrites the tape from the beginning and rewinds.
 
> I did this on multiple sub dirs, just as a test.  But when I try to
> reposition the tab, mt -f /dev/st0  fsf 2, I get an input / output error

Depending on what you did after above commands, there is probably only one
file and one or two EOF marks on the tape. You can't read behind the last
one.

You probably should do:

mt -f /dev/nst0 rewind  #Rewind; Note, after a tape was inserted the
                        #kernel normal makes this on its own when the tape
                        #is first opened, /dev/st0 could be used here too,
                        #but you might want to get used to nst0

bru -cvf /dev/nst0 /root #Backup /root
bru -cvf /dev/nst0 /etc  #Backup /etc

mt -f /dev/nst0 eof     # Optional: it is common to have two consecutive
                        # EOF marks upon logical end of tape.
mt -f /dev/nst0 rewind  # Finally rewind

To append to an existing tape, do:

mt -f /dev/nst0 eod
bru -cvf /dev/nst0 /something_else
mt -f /dev/nst0 rewind


Note A: All this is dangerous, a mispositioned tape can easily be screwed
up. For reliable Backups I suggest not to append to old tapes. Only write
them in one go (best only one command, or at most several tar's in direct
succesion w/op repositions/tape removal). Otherwise you easily loose data
due to user errors.

Note B: I thought bru would take care of all use with a nifty user
interface. For the above commandline calls I don't see a difference to
what tar does already. Know, as you can easily see, I never used bru. (as
it is not free). 

Michael.

--

Michael Weller: [EMAIL PROTECTED], [EMAIL PROTECTED],
or even [EMAIL PROTECTED] If you encounter an eowmob account on
any machine in the net, it's very likely it's me.

Reply via email to