From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Neil R. Smith" Newsgroups: gmane.os.tru64.managers Subject: SUMMARY:confusing fsf, seod, tape positioning Date: Wed, 03 Jul 2002 18:08:47 -0500 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3D2383FF.A71D72F8@ariel.met.tamu.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1025737731 6222 127.0.0.1 (3 Jul 2002 23:08:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 3 Jul 2002 23:08:51 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.33 #1 (Debian)) id 17PtEw-0001c7-00 for ; Thu, 04 Jul 2002 01:08:50 +0200 Original-Received: (qmail 28037 invoked by uid 5); 3 Jul 2002 23:09:12 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 28029 invoked from network); 3 Jul 2002 23:09:11 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (134.167.3.110) by 0 with SMTP; 3 Jul 2002 23:09:11 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GYP00E564BAV8@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 03 Jul 2002 19:09:11 -0400 (EDT) Original-Received: from ariel.met.tamu.edu (ariel.met.tamu.edu [128.194.104.175]) by emroute3.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0GYP0002O4AO1O@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Wed, 03 Jul 2002 19:08:49 -0400 (EDT) Original-Received: from ariel.met.tamu.edu (gilgal [128.194.104.225]) by ariel.met.tamu.edu (8.8.8+Sun/8.8.8) with ESMTP id SAA07767 for ; Wed, 03 Jul 2002 18:08:46 -0500 (CDT) Original-To: tru64-unix-managers@ornl.gov X-Mailer: Mozilla 4.7 [en] (X11; U; IRIX 6.2 IP22) X-Accept-Language: en Xref: main.gmane.org gmane.os.tru64.managers:830 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:830 Root of problem: mt seod option in Tru64 v5.x and Compaq DLT7000 tape drive lets you do something you should not be able to do -- write data after EOT !AND! leaves that EOT in place. Normal tape format for 3 successive writes by an application, say tar: BOT file EOF file EOF file EOF EOF [nothing here] --- --- [EOT] where BOT=Beginning of tape, EOF=End Of File, and EOT=End of Tape which is made up of two EOF's. Tape positioning: mt -f /dev/ntape/tape0c fsf n -- moves tape forward (toward end of tape) until it has skipped n EOF's, stopping immediately after the last one skipped. mt -f /dev/ntape/tape0c bsf n -- moves tape backward (toward beginning of tape) until it has skipped n EOF's, stopping immediately after the last one skipped; which leaves you on the BOT side of an EOF. [an appl. read issued here will result in I/O error, but will have left you on the EOT side of that EOF so that an immediate follow-on read would be successful if there were data on that side] mt -f /dev/ntape/tape0c seod -- puts you at the 'far' (end of tape) side of the two EOF's (EOT), not between them! So the next write after a seod results in: So to navigate the tape after the fact, you have to recognize that there exist back-to-back EOF's which will require more fsf or bsf skips than you would otherwise expect. e.g.., > mt rewind > mt -f /dev/ntape/tape0c seod BOT file EOF file EOF file EOF EOF file EOF EOF --- --- --- --- leaves you here ^ after which a > mt -f /dev/ntape/tape0c bsf 3 BOT file EOF file EOF file EOF EOF file EOF EOF --- --- --- --- leaves you here ^ Please send in clarifications and additional helpful notes as follow-on to this summary, since the above certainly does not exhaust the the matter and only represents my understanding of the replies from: Lucien HERCAUD Pat O'Brien Mark McCann to whom I extend much thanks. -Neil > -----Original Message----- > From: Neil R. Smith [mailto:neils@ariel.met.tamu.edu] > Sent: Monday, June 24, 2002 6:59 PM > To: tru64-unix-managers@ornl.gov > Subject: confusing fsf, seod, tape positioning > > > What does "mt -f [ntape device] seod" do? > Experiment: Tru64 5.1A > > mt rewind (only one tape device: a COMPAQ DLT7000) > > tar cf /dev/ntape/tape0_d1 dir1 > > tar cf /dev/ntape/tape0_d1 dir2 > > tar cf /dev/ntape/tape0_d1 dir3 > > mt rewind > > mt -f /dev/ntape/tape0_d1 seod > > tar cf /dev/ntape/tape0_d1 dir4 > > Tapex -m says there's only 3 files on the tape. > Plus: > > mt rewind > > mt -f /dev/ntape/tape0_d1 fsf 3 > > tar tf /dev/ntape/tape0_d1 gives 'no data' > > BUT!: > > mt rewind > > mt -f /dev/ntape/tape0_d1 seod > > mt -f /dev/ntape/tape0_d1 bsf 3 > > mt -f /dev/ntape/tape0_d1 fsf 1 > > tar tf /dev/ntape/tape0_d1 will read the dir4 tape archive > AND > > mt rewind > > mt -f /dev/ntape/tape0_d1 seod > > mt -f /dev/ntape/tape0_d1 bsf 5 (!?) > > mt -f /dev/ntape/tape0_d1 fsf 1 > > tar tf /dev/ntape/tape0_d1 will read the dir3 tape archive > > This is maddening, at least in part because I can't seem to locate > comprehensive documentation on EOF writes and how/when they > are implemented by utilities like tar and vdump/vrestore. I have > more familiarity with other unix flavors wherein each utility > or mt 'fsf' or 'bsf' always leaves you on the end-of-tape side > of an EOF ready to read or write. -- Neil R. Smith, Comp. Sys. Mngr. neils@ariel.met.tamu.edu Dept. Atmospheric Sci., Texas A&M Univ. 979/845-6272 FAX:979/862-4466