5.12.1. Partitioning schemes
When it comes to partitioning your machine, there is no universally correct way to do it. There are many factors that must be taken into account depending on the purpose of the machine.
For a simple workstation with limited disk space, such as a laptop, you may have as few a 3 partitions. A partition for /, /boot, and swap. However, for most users this is not a recommended solution.
The traditional way is to have a (relatively) small root filesystem, and separate partitions for filesystems such as /usr and /home>. Creating a separate root filesystem if the root filesystem is small and not heavily used, it is less likely to become corrupt when the system crashes, and therefore make it easier to recover a crashed system. The reason is to prevent having the root filesystem get filled and cause a system crash.
When creating your partitioning scheme, there are some things you need to remember. You cannot create separate partitions for the following directories: /bin, /etc, /dev, /initrd, /lib, and /sbin. The contents of these directories are required at bootup and must always be part of the / partition.
It is also recommended that you create separate partitions for /var and /tmp. This is because both directories typically have data that is constantly changing. Not creating separate partitions for these filesystems puts you at risk of having log file fill up our / partition.
An example of a server partition is:
|
Filesystem Size Used Avail Use% Mounted on /dev/hda2 9.7G 1.3G 8.0G 14% / /dev/hda1 128M 44M 82M 34% /boot /dev/hda3 4.9G 4.0G 670M 86% /usr /dev/hda5 4.9G 2.1G 2.5G 46% /var /dev/hda7 31G 24G 5.6G 81% /home /dev/hda8 4.9G 2.0G 670M 43% /opt
</font> | | --- |
The problem with having many partitions is that it splits the total amount of free disk space into many small pieces. One way to avoid this problem is to use to create Logical Volumes.