Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Nov 2013 22:12:18 -0800
From:      John-Mark Gurney <jmg@funkthat.com>
To:        freebsd-doc@FreeBSD.org
Subject:   What are the limits for FFS file systems? 10+ years out of date..
Message-ID:  <20131124061218.GQ7069@funkthat.com>

next in thread | raw e-mail | index | archive | help

--gE7i1rD7pdK0Ng3j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Attached is a patch that bring this up to date..  This was written back
when we were using UFS1 w/ 32bit block addresses...  Things have changes
now that UFS2 is standard...

The big thing is listing the memory requirements for fsck as the main
limiting factor on FS size...

I've had Kirk review the patch, and he's fine w/ it...

Shall I just commit it?

Thanks for the review.

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."

--gE7i1rD7pdK0Ng3j
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="ffs.faq.patch"

Index: book.xml
===================================================================
--- book.xml	(revision 43223)
+++ book.xml	(working copy)
@@ -1338,92 +1338,25 @@
 	</question>
 
 	<answer>
-	  <para>For FFS file systems, the maximum theoretical limit is
-	    8&nbsp;TB (2&nbsp;G blocks), or 16&nbsp;TB for the default
-	    block size of 8&nbsp;KB.  In practice, there is a soft limit
-	    of 1&nbsp;TB, but with modifications file systems with
-	    4&nbsp;TB are possible (and exist).</para>
+	  <para>For FFS file systems, the largest file system is practically
+	    limited by the amount of memory required to fsck the file
+	    system.  fsck requires one bit per fragment, which with the
+	    the default fragment size of 4&nbps;KB equates to 32&nbps;MB
+	    of memory per TB of disk.  This does mean that on systems
+	    which limit userland processes to 2&nbps;GB (such as i&nbps;386),
+	    the maximum fsck'able filesystem is ~60&nbps;TB.</para>
 
+	  <para>If there was not a fsck memory limit, the maximum
+	    filesystem size is 2&nbps;^&nbps;64 (blocks) * 32&nbps;KB =>
+	    16 Exa * 32&nbps;KB => 512 ZettaBytes.</para>
+
 	  <para>The maximum size of a single FFS file is approximately
-	    1&nbsp;G blocks, or 4&nbsp;TB with a block size of
-	    4&nbsp;KB.</para>
-
-	  <table>
-	    <title>Maximum File Sizes</title>
-
-	    <tgroup cols="3">
-	      <thead>
-		<row>
-		  <entry>FS Block Size</entry>
-
-		  <entry>Works</entry>
-
-		  <entry>Should Work</entry>
-		</row>
-	      </thead>
-
-	      <tbody>
-		<row>
-		  <entry>4&nbsp;KB</entry>
-
-		  <entry>&gt;&nbsp;4&nbsp;GB</entry>
-
-		  <entry>4&nbsp;TB&nbsp;-&nbsp;1</entry>
-		</row>
-
-		<row>
-		  <entry>8&nbsp;KB</entry>
-
-		  <entry>&gt;&nbsp;32&nbsp;GB</entry>
-
-		  <entry>32&nbsp;TB&nbsp;-&nbsp;1</entry>
-		</row>
-
-		<row>
-		  <entry>16&nbsp;KB</entry>
-
-		  <entry>&gt;&nbsp;128&nbsp;GB</entry>
-
-		  <entry>32&nbsp;TB&nbsp;-&nbsp;1</entry>
-		</row>
-
-		<row>
-		  <entry>32&nbsp;KB</entry>
-
-		  <entry>&gt;&nbsp;512&nbsp;GB</entry>
-
-		  <entry>64&nbsp;TB&nbsp;-&nbsp;1</entry>
-		</row>
-
-		<row>
-		  <entry>64&nbsp;KB</entry>
-
-		  <entry>&gt;&nbsp;2048&nbsp;GB</entry>
-
-		  <entry>128&nbsp;TB&nbsp;-&nbsp;1</entry>
-		</row>
-	      </tbody>
-	    </tgroup>
-	  </table>
-
-	  <para>When the FS block size is 4&nbsp;KB, triple indirect
-	    blocks work and everything should be limited by the maximum FS
-	    block number that can be represented using triple indirect
-	    blocks (approx.
-	    1024<superscript>3</superscript>&nbsp;+&nbsp;1024<superscript>2</superscript>&nbsp;+&nbsp;1024),
-	    but everything is limited by a (wrong) limit of
-	    1&nbsp;G&nbsp;-&nbsp;1 on FS block numbers.  The limit on FS
-	    block numbers should be 2&nbsp;G&nbsp;-&nbsp;1.  There are
-	    some bugs for FS block numbers near 2&nbsp;G&nbsp;-&nbsp;1,
-	    but such block numbers are unreachable when the FS block
-	    size is 4&nbsp;KB.</para>
-
-	  <para>For block sizes of 8&nbsp;KB and larger, everything
-	    should be limited by the 2&nbsp;G&nbsp;-&nbsp;1 limit on FS
-	    block numbers, but is actually limited by the
-	    1&nbsp;G&nbsp;-&nbsp;1 limit on FS block numbers.  Using the
-	    correct limit of 2&nbsp;G&nbsp;-&nbsp;1 blocks does cause
-	    problems.</para>
+	    2&nbsp;PB with the default block size of 32&nbsp;KB.  Each
+	    32&nbsp;KB block can point to 4096 blocks.  With triple
+	    indirect blocks, the calculation is 32&nbps;KB * 12 +
+	    32&nbps;KB * 4096 + 32&nbps;KB * 4096^2 + 32&nbps;KB *
+	    4096^3.  Increasing the block size to 64&nbsp;KB will increase
+	    the max file size by a factor of 16.</para>
 	</answer>
       </qandaentry>
 

--gE7i1rD7pdK0Ng3j--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20131124061218.GQ7069>