blocks vs kilos (my brain has gone dead)

2007-12-24 22:05:00

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

Comments

Got something to say?

You must be logged in to post a comment.