Subject: mt: how many files on tape?
To: NetBSD Users <netbsd-users@NetBSD.org>
From: Louis Guillaume <lguillaume@berklee.edu>
List: netbsd-users
Date: 08/21/2004 00:46:32
Is there a way to tell how many "files" are on a tape using mt?

On the tape in question, dumps were done with -a.

# dmesg |grep st0
st0 at scsibus0 target 0 lun 0: <SONY, SDT-7000, 0148> tape removable
st0: density code 19, 512-byte blocks, write-enabled
st0: sync (100.00ns offset 15), 8-bit (10.000MB/s) transfers

This is on NetBSD-2.0E, but I've noticed this behaviour for a long time.
Since it's less frustrating than any other mt I've used :) I never
thought twice about it.

I've tried to: mt eom , mt bsf 2, mt fsf 1. Now I should be at the last
file on the tape, right? but

# mt rewind
# mt eom
# mt status
SCSI tape drive, residual=0
ds=3<Mounted>
er=0
blocksize: 0 (0, 0, 0, 0)
density: 19 (0, 0, 0, 0)
current file number: -1
current block number: -1
# mt bsf 2
# mt fsf 1
# mt status
SCSI tape drive, residual=0
ds=3<Mounted>
er=0
blocksize: 0 (0, 0, 0, 0)
density: 19 (0, 0, 0, 0)
current file number: -1
current block number: -1

... what should we really expect here? I know tapes are difficult by
nature but how much can we reliably know about the data on there using mt?

It would also be nice to do an "append" to the tape, so we don't really
need to know how many files are already on there when adding another.
Possible?

Any help would be great, thanks in advance...

Louis