LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Capacity verify written into the Tape (https://www.linuxquestions.org/questions/linux-server-73/capacity-verify-written-into-the-tape-627947/)

dylan912 03-14-2008 12:14 AM

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

MensaWater 03-16-2008 08:43 AM

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.

choogendyk 03-17-2008 04:58 PM

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.

terryxela 04-12-2008 11:17 AM

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)=-


All times are GMT -5. The time now is 09:12 PM.