In
unix, the file size is stored in the
inode
in both
bytes and in
blocks. These two numbers
would normally correspond, except when the file contains
a
hole. Some systems also count
indirect blocks
in the block size of the file, but never in the byte size.
Because the file size is stored in the inode, the maximum
allowable file size in unix is whatever the inode number
will support. On older systems, this is 31 bits, or 2G.
On modern systems, the file size is 63 bits, so other
limits occur first, such as the maximum index of a block,
which on most systems is still 32 bits, so the maximum
file size (without holes) would be 2**42, or 4TB.
The list of possible file size limitations varies depending on the filesystem flavor in use, for example ufs.