Subject: Scsi tapes - better MTEOM handling
To: None <tech-kern@NetBSD.ORG>
From: Juergen Hannken-Illjes <>
List: tech-kern
Date: 02/25/1997 13:02:23
Currently scsi tapes handle EOM differently. QIC drives put one filemark
after the last file on tape while all other drives put two filemarks
after the last file (seems to be a relict from the old 1/2" tapes).

This gives problems when using the MTEOM command (mtio). This command
positions after the last filemark for QIC drives so the next write appends
a new file. For all other drives MTEOM positions AFTER the last (second)
filemark and the next write introduces an empty file (two conscutive filemarks).

It would be better to change semantics as follows:

    If the tape drive is not a QIC drive (st->flags has ST_2FM_AT_EOD)
    the MTEOM command should space to EOM and then backspace one filemark
    so the new position is between the last two filemarks.

User programs could run 'mt eom; write new file' independent of the tape drive.

SunOS4.1.4 does it the same way (from mtio.4):

     MTEOM positions the tape at a location just after  the  last
     file written on the tape.  For 1/4" cartridge and 8 mm tape,
     this is after the last file mark on the tape.  For 1/2" reel
     tape,  this is just after the first file mark but before the
     second (and last) file mark on the tape.   Additional  files
     can then be appended onto the tape from that point.

Juergen Hannken-Illjes - - TU Braunschweig (W Germany)