Subject: Re: Addiind a new filesystem support
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 05/04/2002 18:38:26
> So my question is: What is the general limit for file and file system
> size in NetBSD, independent of the actual file system type?  2^64 - 1
> bytes?

For files, that sounds right.  For filesystems, I'm not sure there is a
limit, if you're willing to live with bogons in df(1) output and
suchlike.  I can't see any reason why, for example, an NFS filesystem
couldn't be of more or less unlimited size, assuming of course a server
that could handle it.

However, 2^64 is close enough to unlimited for the near future.  It's
got a long way to go before running into theorretical limits - 2^64 is
only about 1.8e19, and Avogadro's number is some 6.022e23, so it's
still about five bits away from the "one for every molecule in a mole"
point - but on the other hand, it's only five bits from it, and it's
hard to imagine that we'll be storing one bit using only tens of
thousands of atoms anytime soon, especially for nonvolatile storage.

By a very rough calculation I just did, the "one for every atom in the
earth" point is about 160 bits.  We'll probably have to go to 256 bits
before we get to the "this is enough until we build them out of other
than matter and put them in other than space" point.  (Of course, by
the time we get anywhere near that sort of storage density, we quite
possibly _will_ be building our storage out of other than matter and
placing it in other than space.)

> What about LFS?  Where is the limit for LFS?

I don't know what LFS's limits are.  But you'll run into other problems
in that most supported disk interfaces have limits in the low TB.  For
example, SCSI, even with 10-byte CDBs, can't address more than 2^32
blocks; if we're still stuck with 512-byte blocks (did the
other-block-size work ever bear fruit?), that's a 2TB limit.  I think
IDE LBA also has a 32-bit limit, but I'm much less sure of that.

Now, I do see 8 more bits in struct scsipi_rw_big.  That factor of 256
might hold us for another decade or so....

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B