From - Mon Sep 16 15:50:48 1996 Newsgroups: comp.sys.sgi.misc Path: news.unizar.es!news.rediris.es!news.belnet.be!swsbe6.switch.ch!swidir.switch.ch!in2p3.fr!univ-lyon1.fr!pasteur.fr!jussieu.fr!math.ohio-state.edu!howland.erols.net!newsserver.jvnc.net!newsreader.jvnc.net!news From: Irv Lustig Subject: Re: How to tell how much of a DAT tape is full? Content-Type: text/plain; charset=us-ascii To: Peter Shenkin Message-ID: <3236D6B0.167E@dizzy.cplex.com> Sender: news@tigger.jvnc.net (Zee News Genie) Content-Transfer-Encoding: 7bit Organization: CPLEX Optimization, Inc. References: <514hdd$5bu@sol.ctr.columbia.edu> Mime-Version: 1.0 Date: Wed, 11 Sep 1996 15:11:44 GMT X-Mailer: Mozilla 2.02S (X11; I; IRIX 5.3 IP20) Lines: 30 Peter Shenkin wrote: > > Given a DAT tape in the drive, with a single tar set on it, how can > I figure out what fraction of its ~2Gb capacity is used up? > Here's what I use. I do nightly backups via /sbin/dump, so there are tape markers between each dump. I dump multiple file systems to /dev/nrtape, so that each dump is separated by a tape marker. After a dump of a single file system is complete, I use the following csh excerpt: mt status >& /tmp/mts.$$ set blk=`cat /tmp/mts.$$ | tail -1 | awk '{print $NF}'` rm /tmp/mts.$$ @ left = $taplen - ( $blk / 100 ) - 1 /sbin/dump "$level"uCf $left"k" /dev/nrtape filesystem At this point, $left gives me the amount (in 1K units) of 1K blocks left on the tape. For $taplen, I use 2000 for 90m tapes, and 1333 for 60m tapes. Note that I am using the "C" option to dump to pass the remaining capacity to the dump command. This has worked pretty accurately for me so far. I did some experiments that seemed to indicate that the "mt status" command was returning a block value that corresponded to approximately 10000 bytes per tape block. -Irv Lustig irv@dizzy.cplex.com Director of Numerical Optimization http://www.cplex.com/~irv/ CPLEX Optimization, Inc. http://www.cplex.com/