"Dr. Michael Weller" wrote:
> 
> 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.

Don't confuse multiple FM's with the NULL data zone that the tape drive
writes on close.  The "write 2 fm's on close" is a Berkeley v. AT&T
thing.  Note that by default, the st driver writes 1 FM on close unless
the user sets the stoptions flag (two-fms) with the mt program (man mt).

> > 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.

Negative, BRU does not write its own EOF/FM.  We let the driver make the
decision as to how the device should be closed based on the BSD/AT&T
settings as mentioned above.

> > 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.

Actually, it's simpler than that - 'mt -f /dev/st0 fsf 1' moves to the
EOT side of the first FM it locates and then closes.  On close, this
issues a rewind since it is the rewinding device.  Its positioning
within the two filemarks is immaterial.

> 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

Your intentions are good here, but, please read on ...

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
                       FAQ MOST IMPORTANT FACT FOLLOWS
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

When working with tape devices where manipulations of the tape location
outside of reading from the beginning of the tape is required ALWAYS USE
THE NON-REWINDING DEVICE.  This device is indicated by the prefix letter
'n' on all UNIX platforms that I am aware of (34 to date) - i.e.:
/dev/nst0, /dev/nrst0, /dev/nrct0, /dev/nrStp0, /dev/nqft0.  Using this
device ensures that the tape stays located where you wanted it.

{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
                       FAQ ANOTHER IMPORTANT FACT FOLLOWS
}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{

When WRITING to a tape, there are only TWO locations where writing is
allowed:

        LBOT - Logical Beginning Of Tape 
               (LBOP on drives that support partitions)
        LEOD - Logical End Of Data

Attempts to write to the tape at any other location MUST fail.  If it
does not fail, something is batty with the implementation of the driver
be used and any data written should be considered very suspect.

------------------------------------------------------------------------
Michael provides a very good example of manipulating the tape for
appending data.
------------------------------------------------------------------------
> 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.

I don't know how this could be dangerous so far as screwing up an
existing tape, but it does make keeping track of what files are where on
a tape more difficult, as you mention.  I do agree with one backup job
per tape.

> 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).

BRU's X11 interface does handle this.  The original author was running
this from the command line, which requires manual manipulation.

--
Tim Jones                               [EMAIL PROTECTED]
Vice President                          Visit our tape backup web pages:
Enhanced Software Technologies, Inc.    http://www.estinc.com/

Reply via email to