Chapter 4. Linux Installation and Package Management (Topic 1.102)

Many resources, such as the book Running linux (O'Reilly) describe linux installation . Despite its title, this section's Topic and Objectives do not provide an overview for the installation of any particular Linux distribution. Rather, they focus on four installation Topics and packaging tools as required for LPI Exam 101.

Tip

As of the Release 2 LPI Exams, knowlege of both Debian (Objective 5) and RPM Package Managers (Objective 6) are no longer required. Instead, you are given a choice of which package manager you wish to be tested on.

Objective 1: Design Hard Disk Layout

This Objective covers the ability to design a disk partitioning scheme for a Linux system. The Objective includes allocating filesystems or swap space to separate partitions or disks and tailoring the design to the intended use of the system. It also includes placing /boot on a partition that conforms with the BIOS's requirements for booting. Weight: 5.

Objective 2: Install a Boot Manager

An LPIC 1 candidate should be able to select, install, and configure a boot manager . This Objective includes providing alternative boot locations and backup boot options using either LILO or GRUB. Weight: 1.

Objective 3: Make and Install Programs from Source

This Objective states that you should be able to build and install an executable program from source. This includes being able to unpack a source file. Candidates should be able to make simple customizations to the Makefile such as changing paths or adding extra include directories. Weight: 5.

Objective 4: Manage Shared Libraries

This Objective includes being able to determine the shared libraries that executable programs depend on and install them when necessary. The Objective also includes stating where system libraries are kept. Weight: 3.

Objective 5: Use Debian Package Management

This Objective indicates that candidates should be able to perform package management on Debian-based systems . This indication includes using both command-line and interactive tools to install, upgrade, or uninstall packages, as well as find packages containing specific files or software. Also included is obtaining package information such as version, content, dependencies, package integrity, and installation status. Weight: 8.

Objective 6: Use Red Hat Package Manager (RPM)

An LPIC 1 candidate should be able to use package management systems based on RPM. This Objective includes being able to install, reinstall, upgrade, and remove packages as well as obtain status and version information on packages. Also included is obtaining package version, status, dependencies, integrity, and signatures. Candidates should be able to determine what files a package provides as well as find which package a specific file comes from. Weight: 8.

Objective 1: Design a Hard Disk Layout

Part 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.

System Considerations

A variety of factors influence the choice of a disk layout plan for Linux, including:

  • The amount of disk space

  • The size of the system

  • What the system will be used for

  • How and where backups will be performed

Limited disk space

Except 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:

/boot

50 MB. A small /boot filesystem in the first partition ensures that all kernels are below the 1024-cylinder limit.

/

850 MB. A large root partition holds everything on the system that's not in /boot.

swap

100 MB.

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).

Larger systems

On 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:

/boot

100 MB. Keep kernels under the 1024-cylinder limit.

swap

1 GB.

/

500 MB (minimum).

/usr

4 GB. All of the executables in /usr are shared to workstations via read-only NFS.

/var

2 GB. Since log files are in their own partition, they won't threaten system stability if the filesystem is full.

/tmp

500 MB. Since temporary files are in their own partition, they won't threaten system stability if the filesystem is full.

/home

90 GB. This is the big filesystem, offered to users for their home directories.

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.

System role

The 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.

Backup

Some 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.

Swap Space

When 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.

General Guidelines

Here are some guidelines for partitioning a Linux system:

  • Keep the root filesystem (/) simple by distributing larger portions of the directory tree to other partitions. A simplified root filesystem is less likely to be corrupted.

  • Separate a small /boot partition below cylinder 1024 for installed kernels used by the system boot loader.

  • Separate /var. Make certain it is big enough to handle your logs and their rotation scheme.

  • Separate /tmp. Its size depends on the demands of the applications you run. It should be large enough to handle temporary files for all of your users simultaneously.

  • Separate /usr and make it big enough to accommodate kernel building. Making it standalone allows you to share it read-only via NFS.

  • Separate /home for machines with multiple users or any machine where you don't want to affect data during distribution software upgrades. For even better performance (for multi-user environments) put /home on a disk array.

  • Set swap space to at least the same size (double preferred) as the main memory.

Get LPI Linux Certification in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.