4.1. Objective 1: Design a Hard Disk LayoutPart of the installation process for Linux is the design of the hard disk partitioning scheme. If you're used to systems that reside on a single partition, this step may seem to complicate the installation. However, there are advantages to splitting the filesystem into multiple partitions and even onto multiple disks. You can find more details about disks, partitions, and Linux filesystem top-level directories in Chapter 6. This Topic covers considerations for implementing Linux disk layouts. 4.1.1. System ConsiderationsA variety of factors influence the choice of a disk layout plan for Linux, including:
4.1.1.1. Limited disk spaceExcept for read-only filesystems (such as CD-ROMs or a shared /usr partition), most Linux filesystems should have some free space available. Filesystems holding user data should be maintained with a maximum amount of free space to accommodate user activity. When considering the physical amount of disk space available, you may be forced to make a trade-off between the number of filesystems in use and the availability of free disk space. Finding the right configuration depends on system requirements and available disk resources. When disk space is limited, you may opt to reduce the number of filesystems, thereby combining free space into a single contiguous pool. For example, installing Linux on a PC with only 1 GB of available disk space might best be implemented using only a few partitions:
The /boot partition could be combined with the root partition as long as the entire root partition fits within the 1024-cylinder limit (see Chapter 3). 4.1.1.2. Larger systemsOn larger platforms, functional issues such as backup strategies and required filesystem sizes can dictate disk layout. For example, suppose a file server is to be constructed serving 100 GB of executable data files to end users via NFS. Such a system will need enough resources to compartmentalize various parts of the directory tree into separate filesystems and might look like this:
On production servers, much of the system is often placed on redundant media, such as mirrored disks. Large filesystems, such as /home, may be stored on some form of disk array using a hardware controller. 4.1.1.3. System roleThe role of the system also can dictate disk layout. In a traditional Unix-style network with NFS file servers, most of the workstations won't necessarily need all of their own executable files . In the days when disk space was at a premium, this represented a significant savings in disk space. While space on workstation disks isn't the problem it once was, keeping executables on a server still eliminates the administrative headache of distributing updates to workstations. 4.1.1.4. BackupSome backup schemes use disk partitions as the basic unit of system backup. In such a scenario, each of the filesystems listed in /etc/fstab is backed up separately, and they are arranged so that each filesystem fits within the size of the backup media. For this reason, the available backup device capabilities can play a role in determining the ultimate size of partitions. 4.1.2. Swap SpaceWhen you install Linux, you're asked to configure a swap, or virtual memory, partition. This special disk space is used to temporarily store portions of main memory containing programs or program data that is not needed constantly, allowing more processes to execute concurrently. An old rule of thumb for Linux is to set the size of the system's swap space to be double the amount of physical RAM in the machine. For example, if your system has 512 MB of RAM, it would be reasonable to set your swap size to at least 1 GB. These are just guidelines of course. A system's utilization of virtual memory depends on what the system does and the number and size of processes it runs. As hard disk and memory gets cheaper and Linux application footprints grow, the guidelines for determining swap sizes become more and more about personal preference. However, when in doubt, using twice the amount of main memory is a good starting point. 4.1.3. General GuidelinesHere are some guidelines for partitioning a Linux system:
|