[comp.sys.sgi] The tar -r optione

operator@IRIS.KTH.DK (Martin Liversage) (12/03/90)

We just got a Kennedy 9600 1/2" 9 track tape station interfaced
through the SCSI bus. I want to be able to create incremental archives
on a tape. That is, I want to create an archive an later add more
files to it. Sounds easy, doesn't it? Just use tar -r. The man page
describes the -r option:

> Append the named files at the end of the archive. On tape, named files
> are appended at the end of the last archive on tape. This function is
> only supported on half-inch nine track tape drives.

Well it doesn't work (so much for RTFM). Instead tar aborts with an
error message. I got the GNU tar and it didn't work either. After some
edge'ing I discovered what tar does (this is just what I think it does
- I'm no tar wizard).

It reads blocks until the end of the archive. Then it backspaces one
block (the last one) and pads this one with the beginning of the new
data. Then it writes the block to the tape and probably will continue
writing blocks with the rest of the data to be appended. But the write
after the backspace will not work. This is explained in the mtio(7)
man page:

> A tape is normally open for reading and/or writing, but a tape cannot
> be read and written simultaneously. After a rewind, an unload, or an
> MTAFILE ioctl, writes may follow reads and vice-versa, otherwise only
> reads, or only writes may be done unless the tape is first closed;
> performing an MTWEOF ioctl is considered to be a write operation.
> Whenever the tape is closed after being written to, a file-mark is
> written (2 on 9 track tapes) unless the tape has been unloaded or
> rewound just prior to the close.

So while appending to the archive the tape is opened for reading. Tar
has to do an MTAFILE ioctl before doing the write, but it doesn't.

The nice thing about the 9 track drive is that it has the MTAFILE
ioctl, so what I want is an archive program that will take advantage
of this feature.

Does anybody know of a tar that will work or any other archive program
that will enable me to incrementally store files on a 9 track tape?

Thanks in advance,

Martin Liversage <operator@iris.kth.dk>
Royal Dental College Copenhagen
Department of Pediatric Dentistry
Norre Alle 20
DK-2200 Kobenhavn N

olson@anchor.esd.sgi.com (Dave Olson) (12/05/90)

In <9012031527.AA08340@iris.kth.dk> operator@IRIS.KTH.DK (Martin Liversage) writes:

| We just got a Kennedy 9600 1/2" 9 track tape station interfaced
| through the SCSI bus. I want to be able to create incremental archives
| on a tape. That is, I want to create an archive an later add more
| files to it. Sounds easy, doesn't it? Just use tar -r. The man page
| describes the -r option:
| 
| > Append the named files at the end of the archive. On tape, named files
| > are appended at the end of the last archive on tape. This function is
| > only supported on half-inch nine track tape drives.
| 
| Well it doesn't work (so much for RTFM). Instead tar aborts with an
| error message. I got the GNU tar and it didn't work either. After some
| edge'ing I discovered what tar does (this is just what I think it does
| - I'm no tar wizard).

Please folks: many of us at SGI are willing to help with your problems,
but it can be difficult when you don't say what hardware or OS release
you have.  In this case I have adequate hardware info, but no OS info.
tar in 3.2 had some grungy code that limited -r and -u support to the
xm driver.  This wasn't caught (an oversight on my part) until too late
for 3.2.X, so it is fixed in 3.3.  If you don't have 3.3, this is probably
the problem.  Your summary of how -r and -u work are pretty much correct.

| So while appending to the archive the tape is opened for reading. Tar
| has to do an MTAFILE ioctl before doing the write, but it doesn't.

I'm not sure how you determined this, but if you have 3.2.X, you are correct,
see above.
--

	Dave Olson

Life would be so much easier if we could just look at the source code.

operator@IRIS.KTH.DK (Martin Liversage) (12/06/90)

> Please folks: many of us at SGI are willing to help with your problems,
> but it can be difficult when you don't say what hardware or OS release
> you have.  In this case I have adequate hardware info, but no OS info.
> tar in 3.2 had some grungy code that limited -r and -u support to the
> xm driver.

Sorry for the missing info. I have 3.2, so this explains my problem.
Does anybody know of a PD tar (or other archive program) with -r
support for the tps driver (using a 9 track tape drive)?

Martin Liversage

olson@anchor.esd.sgi.com (Dave Olson) (12/08/90)

In <9012060801.AA01592@iris.kth.dk> operator@IRIS.KTH.DK (Martin Liversage) writes:
| Sorry for the missing info. I have 3.2, so this explains my problem.
| Does anybody know of a PD tar (or other archive program) with -r
| support for the tps driver (using a 9 track tape drive)?
| 
| Martin Liversage

It is unlikely, since we have a non-standard ioctl.  Your best bet is
to upgrade to 3.3.1 or 3.3.2.
--

	Dave Olson

Life would be so much easier if we could just look at the source code.