Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!ucsd!ucbvax!IRIS.KTH.DK!operator From: operator@IRIS.KTH.DK (Martin Liversage) Newsgroups: comp.sys.sgi Subject: The tar -r optione Message-ID: <9012031527.AA08340@iris.kth.dk> Date: 3 Dec 90 15:27:38 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 48 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 Royal Dental College Copenhagen Department of Pediatric Dentistry Norre Alle 20 DK-2200 Kobenhavn N