BLOCKS tells you that, when measured in standard 512 byte blocks, 8 blocks have been allocated for this file. IO BLOCK 4096 tells you that i/o to the file will happen in 4096 byte blocks at a time. Putting it all together... the filesystem allocates 4096 byte blocks at a time to a file. Your file is using 1 such block.
it means that if i increase in data of file,then it would occupy 16 blocks on disk
even if size of file is less than 16 block but greater than 8 blocks?
and why do we need block for allocation?
Once you fully use the first 4096 block, yes you will get a 2nd. The filesystem works in blocks for efficiency. Metadata is needed to remember which block is assigned to which file. If the block size was 1 byte, more than half of the filesystem would be needed for meta-data. Also writing one byte at a time would take too long. So it reads and writes data in large blocks and buffers it to reduce the amount of physical I/O.
thanx for this information......
but i would like to know one more thing that why do we need 2 kind of blocks
one block of size 512 bytes & another if I/o BLOCK of 4096 bytes.
wat is the use of first kind of block?
The 512 is only to report the size in a standard format. When you see that a file is using 8 blocks, that means the same thing on all versions of unix. 512 was chosen because some old versions of unix really used a blocksize of 512.