Added a section to usage.txt on configuring ODF partition
authorRachita Kothiyal <rachita@louie.fsl.cs.sunysb.edu>
Thu, 7 Feb 2008 22:45:40 +0000 (17:45 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:35 +0000 (19:03 -0400)
Signed-off-by: Rachita Kothiyal <rachita@fsl.cs.sunysb.edu>
Documentation/filesystems/unionfs/usage.txt

index d6fe6d6c9a075a03fc924e2c624aea6239aaca73..73d16dc3b5efc5f2c37181d1f254f218d0cd2089 100644 (file)
@@ -191,4 +191,75 @@ configfs in /config.
 You can view or modify any read-write Unionfs configfs variables similarly
 to the 'timeout' variable above.
 
+CONFIGURING THE ODF PARTITION
+=============================
+
+The following provides a rough estimate of the ODF partition size and
+configuration.  Since regular files in the union appear as zero-length
+files in the odf, they do not utilize any disk blocks on /odf; they do
+consume inodes though.  Directories contribute to the disk block usage,
+both from their appearance in the /odf/ns as well as their cached contents
+in /odf/ic.  On our setup, where the lower branch contained a Linux kernel
+source tree, we found that majority of the directories consumed less than
+4K disk blocks, and many of those, less than 1K blocks.
+
+Our aim is to minimize the disk block usage per directory, and maximize
+the inodes from the partition.  To achieve this, we configure the /odf
+with blocksize of 1K, and create one inode for every 1K bytes.
+
+The following formula should help us arrive at an estimate:
+
+Odf Size =  Sum of (2XY/B) over all lower branches, where
+
+X = Size of the lower branch
+    % inodes used on lower branch
+Y = ------------------------------
+    % blocks used on lower branch
+B = Number of 1K blocks-per-inode on the lower branch
+
+
+We can then use the following to format the file system on /odf:
+
+       mkfs.ext2 <odf_device> -i 1024 -b 1024
+
+
+Example:
+
+Consider a single lower partition union:
+
+bash> df /n/lower/
+Filesystem           1K-blocks      Used Available Use% Mounted on
+/dev/hdb1              8256604   5681184   2156008  73% /n/lower
+
+bash> df -i /n/lower/
+Filesystem            Inodes   IUsed   IFree IUse% Mounted on
+/dev/hdb1            1048576   43264 1005312    5% /n/lower
+
+
+Here,
+X = 8256604K
+Y = 5/73
+B = 8
+
+odf Size = 2 * 8256604K * 5/(73 * 8)
+        = 141380K
+        = 138M
+
+An /odf partition of size 138M, formatted for 1K blocksize and 1K
+bytes-per-inode should suffice for a union on a 8G lower partition.
+
+
+Caveats:
+
+1. This estimate does not include future branch management which could
+occur on the union.  If you would likely be adding more branches to the
+union at a later time, then those requirements will also have to be
+addressed at the time of configuring /odf.
+
+2. Although in principle /odf can be formatted with any file system,
+the estimate above is made keeping ext2 in mind.  The motivation behind
+the estimate will remain the same, and can be extended to any other
+file system.
+
+
 For more information, see <http://unionfs.filesystems.org/>.