Here is my usual Linux disk partitioning/formatting scheme.
It is crucial keep /home the directory on a separate partitions from the system directories. For those who install third-party software, it is also important to keep and /usr/local and /opt separate. This is because the act of replacing the system will re-format the partitions of the system directories. You don’t want to lose your personal files or your non-distribution program installations in an upgrade.
When you format your disks this way, you can do a system upgrade by only backing up the /etc directory (this must be replaced in an upgrade, but a copy facilitates getting your system settings back).
One of the coolest features of recent kernels is support for the “journalling” file systems, ext4, ext3, jfs, xfs, Reiser. A consistency check of such a file system takes less than a second to complete!
One advantage of ext4 over other journaling filesystems is that it is compatible with ext2, so files an ext3 filesystem can be read by an older operating system that only knows ext2.
| mount point | size | filesystem |
|---|---|---|
| /boot | 1G | ext4 |
| / | 15G | ext4 |
| /usr/local | 1-5G | ext4 |
| /opt | 5-15G | ext4 |
| swap | 2*RAM | swap |
| /home | the rest | ext4 |
Non-distribution software will usually install itself in the special directories /opt or /usr/local. I find it worthwhile to make special partitions of these, so they will survive system updates. The size depends on your use of them. Most modern third-party software now goes in /opt. If you build a lot of your own software, a larger /usr/local might be in order.
For servers, it may be a good idea to put /var and /tmp onto separate partitions. In contrast to the rest of the system directories, these undergo frequent writing. Also, programs may write into these directories in response to the actions of unknown users of the servers. So there are efficiency and security reasons for separating them physically from the rest of the system. This is usually unimportant for a home system.
Another concern with back-ups is that some servers prefer to put their data files in system directories: MySQL puts its files in /var by default. You need to take care that these aren’t wiped in a system upgrade. I usually just put a link from the default location to a directory in /home, which is backed up regularly.