Operating System - HP-UX
1822000 Members
3764 Online
109639 Solutions
New Discussion юеВ

converting blocks to bytes

 
SOLVED
Go to solution
Ragni Singh
Super Advisor

converting blocks to bytes

How and which one do I need to convert. Looking at my fbackup log, I see 2 messages as follows..

fbackup(3055): total file blocks read for backup: 54427462
fbackup(3056): total blocks written to output file /dev/rmt/0m: 54660226..

If someone asked me to calculate how many megs or gigs of data was backed up to tape, how would I calculate this to bytes and which one of the 2 numbers would I use? Any help is greatly appreciated and points will be assigned.
7 REPLIES 7
Stephen Keane
Honored Contributor

Re: converting blocks to bytes

I believe the default for fbackup is 1k blocks.
Pete Randall
Outstanding Contributor

Re: converting blocks to bytes

From the man page:

"+ Number of 1024-byte blocks per record."


Pete

Pete
Fred Ruffet
Honored Contributor

Re: converting blocks to bytes

Sanjit,

difference comes from the fbackup structure information (how many times tape was used, right, and so on).

I think that blocks are 512 bytes. To be sure, load a tape in the drive and issue a "mt -f /dev/rmt/0m status" (use the right device)

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Stephen Keane
Honored Contributor
Solution

Re: converting blocks to bytes

I would use 54427462 (the first figure), as the second figure includes the overheads needed by the fbackup tape format and as such aren't really your data.
Eric Antunes
Honored Contributor

Re: converting blocks to bytes

Hi Sanjit,

It depends of the tape (in my case - DLT tape - it's 512 bytes/block) but it's easy for you to calculate this:

Schedule a cron backup (with SAM) of some large files (more than 10Mb) and check the root mail. You will get something like:

"
...

a PROD/log3b.dbf 204802 blocks
..."

List the file:

"...104858624 May 24 03:47 log3b.dbf"

Dividing 104858624 by 204802, I get 512 bytes/block.

Best Regards,

Eric Antunes
Each and every day is a good day to learn.
Ragni Singh
Super Advisor

Re: converting blocks to bytes

okay, so this is what I get. By the way, Its a DDS3 tape with I believe holds 24 gig compressed data. If my block count is 54427462 and I multiply that by 512, I get 27866860544 bytes. I then take that and convert it to gig, I get 26 gig. How is that possible if all data backed up went on just one tape holding 24 gig compressed and I end up with 26 gigs of data.

Thanks for your time.
C. Beerse_1
Regular Advisor

Re: converting blocks to bytes

About the last question, fitting 26 GB on a 24 GB compressed medium? It is in the compression. There is a fair estimate done on the compression data. If you feed it with already compressed and/or binary data, a compression rate of 2 times is verry hard to get. With ascii data or raw database data, compressions of 2.5 or 3 times are possible.

My experience: sdlt tapes without compression can hold abou 160 GByte. With compression, the estimate is 320 GByte. In our backup, full tapes sometimes hold only 200 GByte, sometmes up to 280 but I never saw over 300 which is possible since a lot of data is already compressed.
make everything as simple as possible, not simpler (A.Einstein??)