How to lay out (partition) your disks for a mail system.
by David CL: FreeBSD's handbook suggests a laughable 50 MB as the size of /var, and the "Auto Defaults" feature will choose 256 MB. On a qmail server, we strongly suggest allocating at least 1GB, perhaps 2GB. This provides ample room for the queue, the quarantine files, the MySQL installation, the logs, etc.
If your /var slice fills up, your toaster will stop accepting mail, and it will stop logging. Give it a decent amount of space.
by Matt Simerson - This is very good advice. It has been my experience that many system catastrophes were immediately preceded by a drive partition becoming full. Normally, that is not a crisis (in and of itself) but the "repairs" done by the inexperienced admin can often be devastating.
So, save yourself (and those who inherit your creations(s)) a favor and size the partitions appropriately enough that you won't need to format that drive again until you retire it in 5 years. Consider how many things you'll be storing in your MySQL database and how much disk space that's likely to use. How many mail users will you have (size up your qmail queue), and how long do you want to save your logs for?
I like to keep a few years worth of mail and web log files around. I have found that particularly useful when I switched log processors and was able to feed the last 3 years worth of http logs into the new one. So, think about how you are going to use your server and then size your partitions accordingly.
On my personal mail servers, I use a 512MB root (/), twice the installed RAM for swap, a 1GB var, and the rest to /usr. I make /home a symlink to /usr/home and that file system layout serves me very well in most cases.
On extremely high volume mail systems, I typically stick with the 512MB root and 2X real RAM for swap but then use a 4-6GB /usr partition and assign the rest of the disk(s) to /var as that's where the majority of the file system use will be. Of course, file servers should also be laid out with similar forethought regarding how they are to be used.
Last modified on 4/5/05.