From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Sheldon Lee Wen Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: How to determine the amount of space left on a tape. Date: Sun, 06 Oct 2002 02:23:57 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <001a01c26d00$f3a04630$0d0da50a@CGIBLAIR.CA> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1033885470 6754 127.0.0.1 (6 Oct 2002 06:24:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 6 Oct 2002 06:24:30 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 17y4q4-0001km-00 for ; Sun, 06 Oct 2002 08:24:28 +0200 Original-Received: (qmail 7772 invoked by uid 5); 6 Oct 2002 06:24:41 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 7763 invoked by uid 49493); 6 Oct 2002 06:24:41 -0000 Original-Received: from sheldon.leewen@cgi.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.24. spamassassin: 2.50-cvs. Clear:SA:0(1.3/5.0):. Processed in 0.515286 secs); 06 Oct 2002 06:24:41 -0000 Original-Received: from unknown (HELO emroute1.cind.ornl.gov) (160.91.4.119) by 0 with SMTP; 6 Oct 2002 06:24:40 -0000 Original-Received: from emroute1.cind.ornl.gov (localhost [127.0.0.1]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H3J00B23R53JQ@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Sun, 06 Oct 2002 02:24:40 -0400 (EDT) Original-Received: from whms0094.cwshs.com (mx1.god.cgi.ca [64.86.141.6]) by emroute1.cind.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H3J00B8AR4QFW@emroute1.cind.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Sun, 06 Oct 2002 02:24:28 -0400 (EDT) Original-Received: from whml0344.cgi.ca ([10.254.251.20]) by whms0094.cwshs.com (Netscape Messaging Server 4.15 whms0094 Jul 22 2001 13:33:35) with SMTP id H3JR4Q00.05X for ; Sun, 06 Oct 2002 02:24:26 -0400 Original-Received: from whms0335.wshs(10.254.245.207) by whml0344.cgi.ca via csmap id 27316; Sun, 06 Oct 2002 02:18:49 -0400 (EDT) Original-Received: from sleewen ([10.165.13.13]) by whms0335.cwshs.com (Netscape Messaging Server 4.15 whms0335 Jan 17 2002 00:23:08) with ESMTP id H3JR0H01.MPP for ; Sun, 06 Oct 2002 02:21:53 -0400 Original-To: tru64-unix-managers@ornl.gov X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal Xref: main.gmane.org gmane.os.tru64.managers:1969 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:1969 Sorry this Summary is so late. Many thanks to everyone who responded. Typically the responses were that this is a non-trival problem (which is what I had expected, but I was hoping that someone had solved it already). I=92ve included the responses that cover most of the replies. =A0 =A0 Original question:=20 =A0 Does anyone know how to determine the amount of space is left on a tape=20 (and conversely how much is used?). =A0 =A0 Answers: =A0 Dr Thomas Blinn: =A0 Totally non-trivial problem.=A0 It used to be easy (when tape drives = were simple and didn't do things like data compression and streaming). =A0 You can use the "tapex" utility (part of the "System Exercisers", see the reference page) with the "-m" option to get a report of the number of records (and sizes) in each file, and the number of files, but it won't tell you how much more data you could write on the tape.=A0 To get = a sense of that, you need to experiment (at least, with most modern tape drives), by actually writing real data with a real program.=A0=20 =A0 If you have a streaming tape drive (most modern SCSI tape drives are streaming drives) but you can't keep the buffer full, you'll wind up with a much lower recorded data density.=A0 If you have a drive that = does data compression, and you feed it data that doesn't compress very well (e.g., JPG images that are already compressed, the .mod files from your /sys/BINARY directory that are mostly compressed, or any other compressed data, such as ZIP files), then you won't get as much data recorded (as measured by on-disk byte counts) than if you feed it data (such as most text files) that's highly compressible. =A0 =A0 Peyton Bland: =A0 >=A0=A0 Does anyone know how to determine the amount of space is left on = a=20 >tape (and conversely how much is used?). =A0 I hope someone else can give you a better answer.=A0 If not, here's how we've estimated this in our lab... =A0 * Our 35/70 GB DLT tapes seem to hold about 57GB before filling up. =A0 * The tapex command (in /usr/field) shows that out drive has a block size of 61,440 bytes. =A0 * At the end of a backup (before rewinding), issue the "mt rdpos" command to get tape position. =A0 >From these things, we can estimate our tape usage.=A0 Not great but = better than nothing... =A0 =A0 Simon Millard: =A0 With compression, the contents of a file will usually determine how compressed the resulting output would be and this could change.=A0 On an DLT IV tape, I managed to get 100Gb which is a lot more that the spec could. =A0 If you are using vdump, then the output will tell you how much data has been written to tape.=A0 With a bit of playing around with a non-rewind device, you can experiment to see how much space is left. =A0 Key Tip,=A0 always ensure that you tape drives have capacity.=A0 Using = an autoloader is an easier way to put large volumes onto multiple tapes. =A0 If you are using vdump, you can see what the maximum size of the data is going to be, du/df will tell you this, so If you are writing scripts, if you need to split the backups, make sure that the file systems will fit. I always put / and /usr on the first tape, and in that order in case I have to do a restore. =A0 Jim Belonis: =A0 The only way is to keep track of the amount you have written. =A0 You can not, e.g. insert a tape that has already been written on and ask the tape drive to tell you how much has been written without reading the whole tape. =A0 The tape drive keeps track of how much it has written since the last tape insertion and there are SCSI commands you can send to it to find out how many tape blocks have been written and what compression ratio has been actually achieved during the current insertion session. =A0 Knowing how much 'space' is left on a tape is really quite hard when the tape drive compresses with a variable efficiency depending on the content of the files to be written. =A0 Peter Gergen: =A0 The answer is to continually write to the tape in 64k blocks until you get an error indicating=20 that the media is at the EOM (end of media) state. Do a quick calculation based on the number of 64k write successfully done and that is the answer as to how much data can fit on the tape. =A0 While writing to the tape now when doing a backup, keep a count of how much data has been written to tape and subtract that from the figure you got when the test above was done and this is the=20 remaining tape capacity. =A0 Note that it is wise to anything around 100MB-500MB less than the test value achieved as a safe value=20 to use as a general tape size value as tapes do vary especially with general wear. =A0 =A0 Sheldon Lee Wen Ottawa Data Center, UNIX Services Phone: 613-740-5900 ext 5363 Pager: 613-780-7281 Email: Sheldon.leewen@cgi.com=A0