Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Oct 1999 21:21:09 -0700 (MST)
From:      John and Jennifer Reynolds <jreynold@primenet.com>
To:        scsi@freebsd.org
Subject:   questions on observed tape navigation behavior
Message-ID:  <14330.52789.99569.326161@localhost.primenet.com>

next in thread | raw e-mail | index | archive | help

Hello -scsi,

I believe this is the correct group for this question(s).

Perhaps somebody can shed some light on the following. I've been messing around
with my TR4 tape drive lately (thanks to all those who helped me figure out the
1 FM@EOD thing!) but have run into some questions w.r.t. navigating files on a
tape. 

First off, I'm in "variable" mode (mt blocksize 0) and am using 54k as my
blocksize when actually writing to the tape with flexbackup (port not yet
comitted, see ports/14108). The tape drive is also put into "1 file mark at
EOD" mode via a quirk entry (tapestore 8000 NS hanging off a 7890).

I wrote 3 files to the tape--afio "dumps" of /, /var, and /home. If I 
rewind the tape, I can successfully do "mt fsf 1" and seek to the next
file and do a restore operation, or "mt fsf 2" and restore the last file.
No problems here doing this.

However, backing the tape up seems to be working non-intuitively to me.

Consider the following sequence of ops that I performed on the same tape.

   1) mt rewind
   2) mt rdhpos : gives '0'
   3) mt fsf 1
   4) mt rdhpos : gives '116'
   5) mt bsf 1
   6) mt rdhpos : gives '115'
   7) rewind again and mt fsf 2
   8) mt rdhpos : gives '697'
   9) mt bsf 1
   10) mt rdhpos : gives '696'

The following is how I picture the layout of the tape (#=filemark):

0                 116                  697
-----------------#--------------------#---------------------#  <--- end of tape
                  ^                    ^
                  |                    |
                  where fsf 1 put      where fsf 2 put
                  the head             the head

At step 5, I was expecting the tape to essentially rewind back to the
beginning. I'd gone forward 1 file, I wanted to go back one file. Same goes for
step 8-9. I seeked forward 2 files and then wanted to go back one file. I
thought that rdhpos whould have returned 116 (which apparently is the beginning
of the "2nd file" on this tape).

Doing "man 4 sa" brings up the SA man page of which I've read and says:

     When reading a variable record/block from the tape, the head is logically
     considered to be immediately after the last item read, and before the
     next item after that. If the next item is a file mark, but it was never
     read, then the next process to read will immediately hit the file mark
     and receive an end-of-file notification.

I can see that after doing an "mt fsf 1" from a rewound tape, rdhpos would
return "116" and the head would be positioned to read the 1st record/block of
the next file.

Same goes for doing "mt fsf 2" from a rewound tape. However, I don't understand
why doing "mt bsf 1" just backs up over the filemark and leaves the head there
(at 115). In order to backup "a file" I have to execute "mt bsf 2" (which also
takes quite a long time in comparison to the fsf ... don't know if that is
"normal").

Are things working the way they're supposed to be? Is it a case of RTFM where
the FM needs some extra verbage to help deconfuse tape newbies? In the case of
the latter, I'd be more than happy to help extend man pages, etc., but first I
need to understand the behavior I'm seeing.

Thanks in advance,

-Jr

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
John Reynolds         Chandler Capabilities Engineering, CDS, Intel Corporation
jreynold@sedona.ch.intel.com  My opinions are mine, not Intel's. Running
jreynold@primenet.com          FreeBSD 3.3-STABLE. FreeBSD: The Power to Serve.
http://www.primenet.com/~jreynold/  Come join us!!! @ http://www.FreeBSD.org/
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-scsi" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14330.52789.99569.326161>