Subject: Re: How is large file support?
To: None <current-users@NetBSD.ORG>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 08/18/1997 17:55:37
>> What is the state of large file suppot on NetBSD?
> NetBSD uses signed 64-bit quantities for file sizes and offsets,
> which implies that you should be able to use files up to (2**63)-1
> bytes in size.

Yes...but note also that FFS filesystems still use 32-bit block
numbers, which means that a filesystem is restricted to 2^41 bytes, two
terabytes if I have the prefixes right.  (This limitation does not
actually restrict the _size_ of a file, only the amount of data stored
in it - a file can have enormous size and still contain very little

Additionally, the limitation to triple indirection imposes a
restriction of its own.  On a filesystem with 8K blocksize (the
default, IIRC), this amounts to a size factor of 8K/4=2K per level of
indirection (the 4 is the number of bytes in a block number), which
compounded on top of an 8K blocksize implies a limit of 64 terabytes
(8K * 2K * 2K * 2K).  This limit _is_ a limit on the file size,
regardless of how sparse the file is.  (It is possible to create
filesystems with blocksizes greater than 8K; I just now created a
16K/4K filesystem.  Each factor of two in the blocksize raises the
limit by a factor of 16 - two for the base blocksize and two for each
level of indirection.  I don't know if there's a limit on filesystem

Thus, if your filesystem is remote, NetBSD imposes only a 63-bit limit
(though some remote filesystem protocols, eg NFSv2, impose smaller
effective limits).  If your filesystem is local, though, you will start
having trouble in the TB range, instead of the (how does it go, kilo,
mega, giga, tera, peta, exa?) 8EB limit implied by "signed 64-bit".

					der Mouse

		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B