FIle and Block size relationships ...

Bill Campbell linux-sxs
Tue Jun 6 19:23:56 PDT 2006


On Tue, Jun 06, 2006, Ben Duncan wrote:

>Ok, I am busily writing my MVISAM package, when I noticed in some intense
>reading about the lINUX file system - file size / block size on files.

>I created a file with exactly 512 BYTES (It is my FILE header FWIW).  I did
>a stat on it and it shows:
...
>Does this mean that my FILE is really using 4096 BYTES of space
>and if I go over 4096 bytes, each "extension" will cost me
>4096 byes (i.e 4100 byes file will really occupy 8192 bytes) ?

Yup.  The block size is the minimum amount of space a file will
take on disk.

As far as I know, this is pretty much any kind of file system.
although it's not as noticeable on *nix file systems as it is on
Microsoft DOS style file systems which have other limitations on
the numbers of entries in FAT tables and such which makes things
very ``intersting'' when dealing with large file systems where
the block sizes get truly humongous.

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

To say that UNIX is doomed is pretty rabid, OS/2 will certainly play a role,
but you don't build a hundred million instructions per second multiprocessor
micro and then try to run it on OS/2.  I mean, get serious.
		-- William Zachmann, International Data Corp


More information about the Linux-users mailing list