Update FFS size limits.

Submitted by: Bruce
This commit is contained in:
Wolfram Schneider 1998-09-08 09:47:20 +00:00
parent fa94861f90
commit 0285e12246
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=3477

View file

@ -1,4 +1,4 @@
<!-- $Id: install.sgml,v 1.10 1998-09-06 10:53:07 wosch Exp $ -->
<!-- $Id: install.sgml,v 1.11 1998-09-08 09:47:20 wosch Exp $ -->
<!-- The FreeBSD Documentation Project -->
<sect>
@ -536,22 +536,86 @@ disk wd2 at wdc1 drive 1 # change from wd3 to wd2
</enum>
<sect1>
<heading>What are the limits for memory and diskspace?</heading>
<heading>What are the limits for memory?</heading>
<p>For memory, the (theoretical) limit is 4 gigabytes. One gigabyte
has been tested; you generally can't buy i386 PCs that can support
much more than that.
<sect1>
<heading>What are the limits for ffs filesystems?</heading>
<p>For ffs filesystems, the maximum theoretical limit is 8 terabytes
(2G blocks), or 16TB for the default block size of 8K.
In practice, there is a soft limit of 1 terabyte, but with modifications
filesystems with 4 terabytes are possible (and exist).
<p>The maximum size of a single ffs file is approximately 1G blocks
(4TB) if the block size is 4K, else approximately
2G blocks. Files with holes may be larger than the filesystem.
Bugs in the filesystem code actually limit the maximum file size
to approximately (blocksize / 4)**2 blocks.
(4TB) if the block size is 4K.
<verb>
maxfilesize
----------------------------------
2.2.7 3.0
fs block size -stable -current works should-work
------------- ------- -------- ----- -----------
4K 4T-1 4T-1 4T-1 4+T
8K 32+G 8T-1 32+G 16T-1
16K 128+G 16T-1 128+G 32T-1
32K 512+G 32T-1 512+G 64T-1
64K 2048+G 64T-1 2048+G 128T-1
</verb>
<p>When the fs block size is 4K, triple indirect blocks work and
everything should be limited by the maximum fs block number that can
be represented using triple indirect blocks (approx. 1K^3 + 1K^2 +
1K), but everything is limited by a (wrong) limit of 1G-1 on fs block
numbers. The limit on fs block numbers should be 2G-1. There are
some bugs for fs block numbers near 2G-1, but such block numbers are
unreachable when the fs block size is 4K.
<p>For block sizes of 8K and larger, everything should be limited
by the 2G-1 limit on fs block numbers, but is actually limited by the
1G-1 limit on fs block numbers, except under -stable triple indirect
blocks are unreachable, so the limit is the maxiumum fs block number
that can be represented using double indirect blocks
(approx. (blocksize/4)^2 + (blocksize/4)), and under -current
exceeding this limit may cause problems. Using the correct limit of
2G-1 blocks does cause problems.
<sect1>
<heading>How can I put 1TB files on my floppy?</heading>
<p>I keep several virtual ones on floppies :-). The maxiumum
file size is not closely related to the maximum disk size. The
maximum disk size is 1TB. It is a feature that the file size can be
larger than the disk size.
<p>The following example creates a file of size 8T-1 using a
whole 32K of disk space (3 indirect blocks and 1 data block) on a
small root partition. The dd command requires a dd that works with
large files.
<verb>
ttyv0:bde@alphplex:/tmp/q> cat foo
df .
dd if=/dev/zero of=z bs=1 seek=`echo 2^43 - 2 | bc` count=1
ls -l z
du z
df .
ttyv0:bde@alphplex:/tmp/q> sh foo
Filesystem 1024-blocks Used Avail Capacity Mounted on
/dev/sd0a 64479 27702 31619 47% /
1+0 records in
1+0 records out
1 bytes transferred in 0.000187 secs (5346 bytes/sec)
-rw-r--r-- 1 bde bin 8796093022207 Sep 7 16:04 z
32 z
Filesystem 1024-blocks Used Avail Capacity Mounted on
/dev/sd0a 64479 27734 31587 47% /
ttyv0:bde@alphplex:/tmp/q> exit
</verb>
<p>Bruce Evans, September 1998
</sect>