Planning File Systems Conclusion
This module dealt with planning filesystems, designing partition layouts and sizes, planning swap space, and adding new hard drives.
You learned that all systems must have at a minimum
Additionally, including a
/tmp partition is sensible so that the
root partition does not fill up with temporary files. It's also a good idea to include a
/boot partition as security in case a problem develops with the
root partition, below which all other directories reside. You also learned that the partitions you choose to install and their sizes depend on the function of the machine. For example, Web servers will need a
/httpd partition to store the Web files and applications. A news server will need to include a large
partition to store the incoming data to be shared.
Finally, you learned the steps involved in installing a new hard drive.
What is the purpose of root and swap partitions in Red Hat linux?
- Root Partition (/):
The root partition, denoted by a single forward slash (/), is one of the most critical components of a Red Hat Linux system. This partition forms the primary hierarchy of the Linux filesystem and is the top-level directory where the entire filesystem is anchored.
The root partition contains all directories and files, either directly or through its subdirectories. These include system configuration files (/etc), command binaries (/bin and /usr/bin), libraries (/lib and /usr/lib), and more. Without a proper root partition, your Red Hat Linux system will not be able to boot.
In terms of sizing, the root partition should be sufficiently large to accommodate system files, installed packages, and running services. While its required size can depend on the specific system usage, a typical root partition might be allocated with 10-50GB of space. However, in a partition scheme where separate partitions are made for /home, /var, and other large directories, the root partition can be smaller.
- Swap Partition:
The swap partition in Red Hat Linux acts as a supplementary area to the system's physical memory (RAM). When the system runs out of RAM, it starts moving inactive pages of memory to the swap space, thereby freeing up RAM for active processes. This process is known as swapping or paging.
While the swap partition can be crucial for systems with limited RAM, it is slower to access than physical memory due to the mechanical nature of disk drives. Hence, it's considered as a safety net that prevents system crashes due to memory exhaustion rather than a replacement for adequate RAM.
The size of the swap partition depends on various factors, including the amount of physical memory, the nature of the tasks being performed, and whether the system will be hibernating (as hibernation data is typically stored in the swap partition). As of Red Hat Enterprise Linux 7, Red Hat's recommendation for swap space in a system with 4GB of RAM or less is the same amount as the RAM. For a system with 4GB to 64GB of RAM, swap space of 0.5 times the amount of RAM is recommended.
In summary, the root partition and the swap partition in Red Hat Linux serve fundamental purposes. The root partition holds the filesystem hierarchy, and the swap partition acts as an overflow area for system memory. Both are essential for the functioning and performance of the Linux system.
Having completed this module, you should be able to:
- List the steps required to plan a filesystem
- Plan partition layout
- Plan partition size
- Enable swap space
- Add a new hard drive
This module introduced you to the following terms:
- 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.
- Partition: A partition is a section of the hard drive reserved for specific directories, applications, or operating systems.
- Swap space: Swap space is the space on a hard disk that computer uses as an extension of its RAM.
- Swapping: Swapping uses space on a hard disk as an extension a computer's RAM. By utilizing swap, the operating system pretends that more RAM is available than the machine actually contains. The oldest files in RAM are "swapped out" to the swap partition until they are needed so that other data can be "swapped in" to RAM.
The next module further examines administering local filesystems.
Administering Local Filesystems - Quiz
Before moving on to the next module, click the Quiz link below to check your understanding of common tasks associated with administering local filesystems.
Administering Local Filesystems - Quiz