File space allocation

...in UNIX

Let's look at specific implementation of index blocks in BSD UNIX:

Block size of 4K, by the way, so we can store 1024 pointers per index block.

12 number of direct blocks, 3 (single) indirect blocks, 1 double indirect blocks, 1 triple indirect blocks.

Direct blocks account for first 12×4K = 48K of file.

Indirect blocks account for 3×1024×4K = 12M of file.

Double indirect block accounts for 1×1024×1024×4K = 4G.

Triple indirect block would account for 1×1024×1024×1024×4K = 4T.

(In principle, BSD files could hold about 4.40 trillion bytes).


last updated 1 April 1998