LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-11-2008, 08:20 AM   #1
alexandrusa
LQ Newbie
 
Registered: Jan 2008
Location: Frankfurt am Main, Germany
Distribution: Debian 4.0, Windows 2003 Server
Posts: 12

Rep: Reputation: 1
Question how to determine the tape usage for a streamer?


Hi,

I'm making backups on a tape-drive using tar:

Code:
tar -cf /dev/st0 /somedir)
I've (or I hope I have) enabled the drive-side compression with:

Code:
mt -f /dev/st0 compression
Now I'd like to see if that had any effect. Is it possible to determine the current usage of a tape?

Alex
 
Old 03-12-2008, 06:38 AM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
Do you mean how much total data can you write to it now? Well, that depends on the data. Some data is compressible, and some data is not. I've got some partitions that compress to 1/10th of their former size and others that compress to about 90% of their former size. Logs versus images.

I've typically used amtapetype (a utility that comes with Amanda) to assess a tape. It will diagnose whether you have compression on, and, with compression off will tell the total capacity and speed of the tape. It takes a long time to run. You don't need the rest of Amanda to run it, but you could install Amanda and then use that utility.

I also use server side software compression rather than the hardware compression on the drive. That gives me more control over planning what will fit on the tape. With adequate cpu, memory, and holding space on the server, that works well for me. In other situations, it might not.
 
Old 03-12-2008, 08:31 AM   #3
alexandrusa
LQ Newbie
 
Registered: Jan 2008
Location: Frankfurt am Main, Germany
Distribution: Debian 4.0, Windows 2003 Server
Posts: 12

Original Poster
Rep: Reputation: 1
Hi choogendyk,

I actually meant to read someway the end-block of a tape that has data on it and calculate how much of the tape is used so far. I especially want to do this to be able to compare it to server-side compression, as you mentioned.

How much should fit on the tape without compression should be written on it.. is there a reason to doubt that info?

Alex
 
Old 03-12-2008, 07:04 PM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
I'm not clear on your last question.

You can certainly get to the end of written data with `mt eom` (end of media). But I don't know that you can tell where you are, how much you passed over to get there, or how much space is left.

The tools like amtapetype treat the tape as a black box. Throw data at it as fast as you can for as long as you can. Record how fast it accepts the data, and record the point at which it throws up its hands and says it can't take anymore. Do that with easily compressible data. Do it with uncompressible data. Compare notes and determine whether the tape is compressing (actually, you can diagnose that in some other ways too, by comparing the speed it takes data between those two cases).

So, I think the only way you can know the behavior, capacity, and compression performance of your tape drive is by doing the same sorts of things. Use dd to throw large quantities of data at it, and/or use a utility like amtapetype.
 
Old 03-13-2008, 05:30 AM   #5
alexandrusa
LQ Newbie
 
Registered: Jan 2008
Location: Frankfurt am Main, Germany
Distribution: Debian 4.0, Windows 2003 Server
Posts: 12

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by choogendyk View Post
I'm not clear on your last question.
I was reffering to:

Quote:
Originally Posted by choogendyk
with compression off will tell the total capacity and speed of the tape
I only meant that I should know how much fits on the tape with compression off.

Quote:
Originally Posted by choogendyk View Post
But I don't know that you can tell where you are, how much you passed over to get there, or how much space is left.
Thats what I wanted to find out.

Quote:
Originally Posted by choogendyk View Post
The tools like amtapetype treat the tape as a black box. Throw data at it as fast as you can for as long as you can. Record how fast it accepts the data, and record the point at which it throws up its hands and says it can't take anymore.
Well I guess that's the only option if my first thought isn't possible, but it'll take loooooong time..

Thanks for your help!
 
Old 10-01-2008, 11:45 AM   #6
Ammad
Member
 
Registered: Apr 2004
Distribution: redhat 9.0, fc4, redhat as 4
Posts: 522

Rep: Reputation: 31
i have same problem , "to know space left on Tape" i am using LT03. i wrote a script that will list the contents and Total space + used space on Tape.
check this and let me know if you have some problems.
thanks

Code:
#!/bin/bash

export TAPE=/dev/nst0
export h=0
clear
echo
echo
echo "                          Listing backup on Tape  "
echo
echo
echo
echo

/bin/mt -f $TAPE rewind
BLOCKS=`/bin/mt -f /dev/nst0 status | grep bits | awk '{print $5}'| tr -d "(" | tr -d ")" | tr -d ":"`
/bin/mt -f $TAPE eod
echo -n  " Total block  on  current Tape : $BLOCKS     / "
echo $(($BLOCKS/102400)) GB
BLOCKSL=`/bin/mt -f /dev/nst0 status | grep bits | awk '{print $5}'| tr -d "(" | tr -d ")" | tr -d ":"`
echo
echo
echo
echo -n  " Total block on used current Tape : $BLOCKSL   / "
echo $(($BLOCKSL/102400)) GB
echo
echo
lastcount=`/bin/mt -f $TAPE status | grep -i file | awk '{print $2}'| tr -d "number=" | tr -d ","`
/bin/mt -f $TAPE rewind
while [ $h -le $lastcount  ]
do
echo -n   "     $h : "
tar tvf $TAPE  | awk '{print $6}'
h=$((h+1))

if [ $h -eq $lastcount ]; then
 exit
else
/bin/mt -f $TAPE fsf 1
fi
done
echo
echo
echo  Report bugs @ "mammadshah@hotmail.com " 
echo  License GNU/GPL
 
  


Reply

Tags
mt, tape, tar


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Tape streamer deweirdt Linux - Hardware 19 04-25-2009 08:35 AM
How do I determine disk space usage? econnections Linux - Newbie 4 08-28-2005 05:16 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM
Input/output error beim Schreib-/Lesezugriff auf Streamer Tape RetroFX Linux - Hardware 2 09-16-2003 08:26 AM
Travan tape streamer problem slothpuck Linux - Hardware 1 07-04-2003 05:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration