Install tip: disklabel partitions
I've got a quick tip regarding how you partition your FreeBSD slice when you are installing. I'm not going to address the D0S partitions (or disk slices as they're usually called in FreeBSD), but the FreeBSD partitions that will be put within the slice (or slices) that you install FreeBSD into. This is covered in the Handbook in the section "2.6.5 Creating Partitions Using Disklabel" found here (as of this writing).
What I suggest is that you alter the default/auto partition recommendations of sysinstall by, at least, eliminating the "/tmp" partition, doubling (at least) the "/var" partition, and then sym-linking "/tmp" to "/var/tmp".
To do this is easy enough. During the install, when I get to the label editor screen I first press the 'A' to see the auto-defaults. Make a quick note of the order and sizes if you need it (I do) and then arrow down and delete all of the proposed partitions. (Remember they haven't actually been created yet.) Then re-add them in the same order, entering your new sizes (and skipping "/tmp"). I usually make "/" a little bigger, too. I would add "/" at 256M, swap at 1xRAM (assuming you've got plenty of RAM, 2xRAM otherwise), "/var" at 1G (for a workstation, more for a server), and the rest to "/usr". Then (important!), remember to create the sym-link as soon as you've rebooted. As root, these commands should do it:
cd /That's it. You're done!
mv tmp/.* var/tmp/
mv tmp/* var/tmp/
rmdir tmp
ln -s /var/tmp
I first got the idea to modify the default partitions from Greg Lehey's book, "The Complete FreeBSD." (A good book and freely available on-line now. See here.) The crucial point he made is that having many partitions was largely a defense against unreliable filesystems. But, filesystems have gotten much better in recent years. Given that, you shouldn't break up your disk into so many pieces without good reasons -- it creates unnecessary bottlenecks ("warning: filesystem full"). His specific recommendation was pretty radical, though: a single, large "/" partition of 4-6 GB, and the remainder of the space in a "/home" partition. (He was assuming a 20GB disk in his example.) I see the advantages of this, especially if you do a lot of work in your home directory that will use space. But, this recommendation has not stood the test of time, as my "/usr" partition is very often much larger than 6GB (to say nothing of when I must extract and compile a large port). Granted, disks (and software) are much larger than when Greg first wrote that, but it still fails to allow for the considerable wildcard of how much third-party software you may eventually end up installing. Also, if you let "/usr" and "/var" ride on "/" you've lost the advantages of the soft-updates for that IO ... or you've enabled soft-updates on your "/" partition and I don't like either of those options.
This article has become longer than I expected. I will follow-up on it soon with my thoughts on why and when you should throw in an extra partition.
Labels: installing