Proper sizing of disk partitions

Quick Version
If you do not know already what size partitions you need, use these:

Disk Partitions: /root   2  GB    swap    (2xRAM)  GB   /var    12  GB     /tmp    1   GB  /usr     8   GB     /home


 * /usr needs a min of 4GB: ports(600-2000M), src (500M), obj (1G), & local (1GB)
 * /var holds logs, databases (mysql, bayesian), email queue

Long Version
Begin by reading man hier and man tuning.

The disk layout shown above will make sense after you have read man hier. Here's a brief explanation of each partition.

/root - contains only the files required by the OS.
 * nothing that changes regularly should be stored on the /root partition. My intent with every server I build is that, once built, /root will be mounted read only so that it cannot be tampered with. FreeBSD 8.2 with 2 kernels installed takes 521MB, so having a 2GB /root leaves plenty of room for the future.

/var - multi-purpose log, temporary, transient, and spool files
 * you will fill up /var eventually, so do not fear making it too large. Your main concern is leaving enough space for your /home partition and whatever you will store there. On a small mail server, 1-2 GB might be plenty. On a busy mail server, anywhere from 4-12GB could be appropriate.

/tmp - anything you don't care about losing after a reboot
 * lots of applications use /tmp for temporary storage, including downloads. I seldom have more than 1MB of data in /tmp but every so often 1GB is barely enough. Having a separate /tmp is much better than having /tmp fill up your /root partition. (panic time!). Another option is to not have a dedicated /tmp partition and instead symlink /tmp to /var/tmp. There are good arguments for doing it each way.

/usr - the majority of user utilities and applications
 * all of the Mail Toaster applications, libraries, and config files will live in /usr. So too does the FreeBSD ports collection, sources, build objects, and other files. 3GB is just barely squeaking by, and 5GB is comfortable.

/home - user specific files
 * on a Mail Toaster, this is the place for your vpopmail home directory. All the delivered email messages get stored on this partition. When it is time to scale your vpopmail installation, /home or somewhere below there is the mount point that will get moved onto another (presumably larger) disk or moved off to a dedicated file server.

Here is a some very relevant file system information from man tuning:


 * The defaults may be unsuitable for a file system that requires a very large number of i-nodes or is intended to hold a large number of very small files. Such a file system should be created with an 8K or 4K block size.  This also requires you to specify a smaller fragment size. We recommend always using a fragment size that is 1/8 the block size (less testing has been done on other fragment size factors).  The newfs(8) options for this would be ``newfs -f 1024 -b 8192 ...''.