Planning partitions and filesystems

The installers of most modern Linux distributions will set up a reasonable partition and filesystem scheme that will work fine for most people. I’m a do-it-yourselfer, however, and here’s what works for me.

If you are installing over an existing Linux installation, print your current partition and filesystem details (df -T | lp) for reference.

Think about what you want. There is no one size fits all partition scheme, but what works for me for standard desktop or laptop use is:

/              8 GB   Root partition
/opt           2 GB
/var/www/html  2 GB   Apache document root
swap           See below
/home          Rest of disk

How I allocate swap depends on whether or not the box will be using hibernation, sometimes called suspend to disk. Most users of laptops and other portable devices expect hibernation to be available, and I happen to find it convenient on my desktop as well.

If the box’s users won’t be hibernating, then I set swap equal to RAM but no more than 2 GB. If they will be, I set swap to 5% more than RAM, regardless of size. And if the hibernating box might have a RAM upgrade in its future, I future-proof the setup by making swap 5% more than the maximum amount of RAM that the motherboard supports.

My box is used for local web development and I don’t want to lose those files when installing a new distro, so giving the Apache docroot its own partition makes sense for me. If you don’t know what I’m talking about, you don’t need it.

The opt partition is where I place things that are not installed via my distribution’s package manager, in order to keep the root filesystem unpolluted. For example, Java applications not in my distro’s repositories go here. By giving opt its own partition I also avoid having to reinstall those things after installing a new distro.

By keeping most partitions reasonably small, I insure that they can be easily imaged onto DVDs. Even the root partition can fit on a dual layer DVD.

Regarding filesystems, I use EXT4, which is the current default for most distros. Most recovery tutorials assume an EXT filesystem, and help is easily found.

I used to have an additional 10 GB partition, /test, which was my sandbox for testing new distros. Now I use VirtualBox, which is a safer playground.

More information on sizing swap
A more complex partitioning scheme; well annotated


About Warren Post

So far: Customer support guy, jungle guide, IT consultant, beach bum, entrepreneur, teacher, diplomat, over-enthusiastic cyclist. Tomorrow: who knows?
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Planning partitions and filesystems

  1. Pingback: Installing a new distribution | A maze of twisty little passages

  2. Pingback: Verdi installation notes, mdv2010.1/2 | A maze of twisty little passages

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s