SUMMARY: blocks vs kilos (my brain has gone dead)

From: <canderson1_at_worldbank.org>
Date: Thu Mar 07 2002 - 13:03:35 EST
Well, the only replies I got were from people explaining the syntax of du (with
and without -k) and why you divide blocks by 2 to get kilobytes.  Since I
already knew that and stated it in my post, they didn't help much.. But thanks
anyway..  Seems to me like noone knows anything (or read to the bottom of my
post :) about how vxstat interprets blocks.. BUUUTTT, MAN PAGES ARE GREAT
(intentionally capitalized :).. man vxintro told me:  "b    (Blocks) Multiply
the length by 512 bytes."  Therefore, vxstat adheres to the same "divide blocks
by 2 to get kilobytes" rule as everything else..

BTW, another way of thinking of it instead of dividing the # of blocks by 2 to
get kilobytes is to multiply the # of blocks by 512 to get the bytes.

E.G.:
4 block=4 * 512 bytes = 2048 bytes = 2 kilobytes (4 divided by 2)

Changa



                                                                                                                                          
                    canderson1@worldbank.or                                                                                               
                    g                              To:     Sunmanagers@Sunmanagers.Org                                                    
                    Sent by:                       cc:                                                                                    
                    sunmanagers-admin@sunma        Subject:     blocks vs kilos (my brain has gone dead)                                  
                    nagers.org                                                                                                            
                                                                                                                                          
                                                                                                                                          
                    03/05/2002 05:50 PM                                                                                                   
                                                                                                                                          
                                                                                                                                          
                                                                                                                                          
                                                                                                                                          




Ok, everybody,
     I've gone brain dead today and for some reason, I can't compute correctly..
Oh yeah, I haven't searched the archives, nor the web, nor the FAQ.. Like I said
"cannot compute, core dumped" :}  ..  hey, it's the end of the day...

Ok, you know how usually, you take the output (which is in blocks) given from
commands like df and du (without -k) and you can divide by 2 to get the # of
kilobytes.  For the life of me, I just can't compute why you divide by 2 to get
the number of kilobytes.

Now this is my train of thought and it just doesn't add up right.. each block is
a 512 byte chunk.. so:

1 block=512 bytes
2 blocks=1024 bytes=1 kilobyte
4 blocks=2048 bytes=2 kilobytes

********
(Note added after email was written:  you'll most likely never see odd numbers
of blocks unless your fragsize is 512 bytes for UFS or your bsize is an odd
multiple of 512 bytes for VXFS (well most of the time for VXFS, see man pages
for mkfs_vxfs for more))
********

Ahh damn.. ok now I see :)  maybe it just took me writing it down to actually
see it.. my brain must've just locked up on me..  Ok, so I've wasted your time
reading this far.. but I've got another question:

When you use Veritas' vxstat and it shows you blocks read and written, can you
just take those blocks and divide by 2 to get kilobytes?  I'm assuming yes,
because it would be silly or impossible for Veritas not to adhere to OS
standards, right?  That would involve rewriting lots of code and even drivers,
right?  And it'd be just plain stupid, right?  Actually, if you think about it,
at the end of the read or write, VM should be using the OS disk drivers anyway,
which write blocks of 512 bytes (man sd & ssd), right?  So maybe I just answered
my question again.. Anybody know something I don't?

Changa
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Mar 7 12:25:14 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:36 EST