LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-14-2008, 12:14 AM   #1
dylan912
LQ Newbie
 
Registered: Dec 2004
Distribution: Redhat
Posts: 18

Rep: Reputation: 0
Unhappy Capacity verify written into the Tape


Hi ALL,

Just a quick question..!

How do we verify the capacity size of written to the Tape. I write some data to the tape;
tar -cf /dev/st0 /home

The /home directory size is 19GB. How do we get written size -- tape compressed or not..

mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x47 (TR-5).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN


du -sh /dev/st0
0 /dev/st0

df -kh /dev/st0
Filesystem Size Used Avail Use% Mounted on
- 1013M 232K 1013M 1% /dev

I have written 19G directory to the tape and it reported 16G written; above command shows 1013M size, but this is 72G cartridge

Any idea..?

Thanks
 
Old 03-16-2008, 08:43 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,829
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
The 19 GB would include filesystem overhead whereas the tape would not.

Also most tape drives can (and should) do hardware compression. Hardware compression typically makes your backups faster. Compression is hard to measure because some things can compress very little whereas others might get 20 to 1 compression depending on how sparse real data is.

The only certain way to verify what you backed up is what is there now is to do a full restore to an alternate location and compare the files between the original source and the alternate restore location. (Many admins have to do this periodically to "prove" backups are working to management.)

For most purposes, however, simply doing a tar with t (table of contents) flag to get list of files on the archive and compare that to a find or ls list of the source should be sufficient. Its not likely to show you a file listed on the tape if it didn't back it up.
 
Old 03-17-2008, 04:58 PM   #3
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
Also note that the du and df commands apply to the directories and partitions on your system, not to the tape. So, even though /dev/st0 is how you refer to your tape drive, df /dev/st0 will find /dev as the partition and tell you what that partition's usage is. du applied to /dev/st0 will tell you that it actually takes no space on your file system.

jlightner has already advised how to check what's on the tape.

If you want to test the behavior and performance of your tape drive, a number of servious open source backup programs come with tape testing utilities. For example, if you install Amanda, you could use the amtapetype utility to check out your drive. It takes quite a while to run. It basically treats the tape drive as a black box, shoving data at it as fast and as long as it can to evaluate speed, compression, capacity, etc.
 
Old 04-12-2008, 11:17 AM   #4
terryxela
Member
 
Registered: Dec 2006
Location: Denver, Colorado, USA
Distribution: SuSE 11.3
Posts: 125

Rep: Reputation: 17
I just saw this message almost a month later

If you have not change the blocking factor and you are using the tar defaults you have:

512 bytes for a block
20 as blocking factor

Therefore each record is

512 x 20 = 10240 bytes

So do these steps:

# mt -f /dev/nst0 eod

or something similar, if you have many files in the tape you can navigate from beginning of the file to beginning of the file with
# mt -f /dev/nst0 fsf n
rewind take you to 0, the fsf 1 will take you to the first block of the second file and so forth.

# mt -f /dev/nst0 tell

this will tell you the record #

if it give you 5000 then

5000 x 10240 = 48.82 MB

What I do is I change the blocking factor (instead of default 20) to 2048. So now when I do <tell> the number reported is in MB because the size of one record is about 1MB.

In summary: I modified a little bit your tar command

# tar -b 2048 -cf /dev/nst0 /home

so now when the archive is finished just

#mt -f /dev/nst0 tell

and you will have the MB used

-=terry(Denver)=-

Last edited by terryxela; 04-12-2008 at 11:19 AM.
 
  


Reply


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
How to backup more than one time on same tape using DLT tape? hocheetiong Linux - Newbie 3 01-30-2008 06:54 AM
bacula - How do I setup up tape daily tape changes neocontrol Linux - Software 3 01-23-2008 09:27 PM
verify tape contents helpmhost Linux - Hardware 5 01-02-2008 01:18 PM
Using a DDS5 tape drive to restore from a DDS3 backup tape. AndrewCAtWayofthebit Linux - Hardware 1 05-14-2006 09:15 AM
HP T4 (t4000) 4/8gb Tape Drive not using full capacity k41184 Linux - Hardware 0 12-06-2005 08:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:38 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration