Administering Filesystems  «Prev  Next»

Lesson 3 Planning partition layout
Objective Plan Partition Layout

Planning Partition Layout in Linux in context of File System Administration

A partition is a section of the hard drive reserved for specific directories, applications, or operating systems. Dividing your hard drive into logical partitions organizes the data on your computer so that locating information or programs is easier. However, the more partitions you have, the smaller each will be; consequently, space can become an issue as a partition fills up with new data. Because of this, you must always consider flexibility of storage vs. organization.
Some of the basic partitions that are included in almost all partition layouts are root (/), swap, /tmp, and /boot. The root filesystem resides at the top of the filesystem hierarchy, all other partitions are mounted below root. The root directory also contains the operating system kernel. The swap partition allows the computer to pretend that more RAM is available than the machine actually contains. /tmp holds the temporary files needed by applications so that they do not fill up the root partition unnecessarily. Finally, /boot contains the static files of the boot loader[1].

Every partition layout must include the following standard partitions:
  1. A root partition
  2. A swap partition

Additionally, it is smart to include the following:
  1. A /tmp partition, to prevent temporary files from filling up the root directory
  2. A /boot partition, which provides extra security to prevent problems during the system boot if there is a problem with the root partition

Machine function, the number of drives, and the backup strategy affect specific partitioning decisions. For example, the following table illustrates the differences in partition layout between a standard workstation and a standard server:
Machine function Partitions
Standard workstation root, swap, /boot, /tmp
root, swap, /boot, /tmp, /user, /home,

Primary considerations

One rule of thumb to maximize flexibility is to use the fewest possible number of partitions per drive, as this will reduce the likelihood that any single partition will run out of space. However, there are many countervailing considerations that in most cases mean you will not end up with a "pure" application of this rule of thumb.
The exceptions arise in the following situations:
  1. When you are trying to maximize speed and you have multiple drives available
  2. When you are using RAID for its redundancy
  3. When you exceed the filesystem's maximum partition size

In these cases, partitions on different drives will help.
Backup is another issue. If you intend to back up partitions, you might want to set the frequency of the backup based on the type of content in the partitions.
An advanced treatment of this issue is available in The Official Red Hat Linux Installation Guide.
Additional information is also available on the Resourcespage.
The following table illustrates a partition strategy based on the machine's function.
Linux box Partitions
Machine Generation General purpose system with 2GB hard drive /, /boot, /tmp, swap, /home, /usr, /var
Machine Web Server Web server /, /boot, /tmp, swap, /home, /usr, /var, /httpd
Machine File Server File server /, /boot, /tmp, swap, /home, /usr, /var
Machine News News server /, /boot, /tmp, swap, /home, /usr, /var
Machine Application
Applications server
/, /boot, /tmp, swap, /home, /usr, /var

[1]Boot loader: The boot loader is program that is responsible for loading the rest of the operating system into the computer's memory at boot time.