Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: alvin <alvin@iplink.net>
To: axp-list@redhat.com
Subject: Re: speed up tape writes with /bin/buffer
Date: Wed, 18 Jul 2001 16:37:01 -0400	[thread overview]
Message-ID: <3B55F36D.C85E2165@iplink.net> (raw)
In-Reply-To: 20010718190603.56143.qmail@web14901.mail.yahoo.com

John Doe wrote:
> 
> Hello List,
> 
> I am trying to write to a tape on a remote linux
> box by using the following command:
> 
> gtar cPvf - $FILELIST | rsh -l $username \
>      $remote_host /bin/buffer -o $TAPE_DEV
> 
> This works really well, reducing the amount of time
> to backup by an order of magnitude (due to the use
> of the /bin/buffer command).
> 
> The old command was:
> 
> gtar rPvf $username@$remote_host:$TAPE_DEV \
>       $FILELIST
> 
> Which took way too much time (but the "r" did
> allow me to append to the existing data).
> 
> My problem is this:
> 
> After writing to the tape once, any subsequent
> backups will overwrite the previous (the tape
> has plenty of room for more files) since the
> buffer command does not have the ability to
> "append" to the tape archive.
> 
> Is there a way to use the first command I listed
> and have it "APPEND" to the tape rather than over
> write it?
> 
> I have tried to use the "no-rewind" option, but one
> of the requirements of the script is that it rewind
> the tape and re-read what is listed to verify that
> all the files got backed up. This would be okay if
> I could find a way to position the tape at the end
> of the existing archives prior to writing to the tape,
> but I've not been able to figure out how to position
> the tape.
> 
> I've used the "mt" command with "eod", but this didn't
> seem to prevent the overwritting of existing files.
> 
> Any suggestions would be appreciated and I will
> summarize.

first you will need to use a nonrewind device like /dev/nst0. Otherwise
every time a program closes the file there will be a rewind done.

One simple solution is to just use a norewind device and just do a
sequence of tars with each one appending after the other.

The other possiblity  is to use mt to forward space to the next file
mark.

Generaly a tape is layed out like this

SOT(start of tape)
data 
FM(file mark)
data
FM(file mark)
...
FM
data
FM
FM
EOT

the 2 file marks in a row are concidered the end of data on the tape and
the EOT is the physical end of tape.

It has been a while and this is only a general direction. You will have
to play a lot go get this working just right.

streaming tapes usualy will only let you append to the tape at the point
where you will find the two FMs in a row. Some will not even let you do
that.

you should be able to read a file(data) from the tape and then forward
space over the file mark and then read the next file(data) and so on
till you get a data read with 0 data. This means you have now found the
2 file marks in a row. You should be able to start writing from this
point.


From the man page on mt you should be able to do somthing like:
mt -f /dev/nst0 eod
tar cf /dev/nst0 /blah/blah
mt -f /dev/nst0 rewind

But I have not tried this one in practice.

-- 
Alvin Starr                   ||   voice: (416)785-4051
Interlink Connectivity        ||   fax:   (416)785-3668
alvin@iplink.net              ||




  parent reply	other threads:[~2001-07-18 20:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-18 19:06 speed up tape writes with /bin/buffer John Doe
2001-07-18 19:15 ` Island Computers
2001-07-18 20:01 ` Tim Tuck
2001-07-18 20:24 ` W Bauske
2001-07-18 20:37 ` alvin [this message]
2001-07-19  7:16 ` Mike Tibor
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox