- swap
This partition is used for virtual memory by the Linux operating system. Essentially, Linux will use the hard disk space contained in the swap partition as though it were system RAM. When the system RAM is under heavy load, the operating system can move information loaded into RAM but not currently in use into the swap partition. This is called swapping, which is the process of moving a page of memory to the preconfigured swap partition on the hard disk.When the data is needed again, it is moved from the swap partition back into RAM. Essentially this allows the system to simultaneously run more programs than it has enough physical RAM to support.
The appropriate size for your swap partition depends on how the system is used. For desktop systems, the general rule of thumb is to use a swap partition that is about twice the size of your system RAM. This is because desktop systems usually run a large number of applications that can be easily swapped to disk. For example, if your desktop has 2G of RAM installed, you should have a swap partition that is about 4GB in size. For server systems, you typically don’t need as much swap space. Usually, a swap partition that is about the same size as your installed RAM is sufficient.
- / {root}
This partition is mounted at the root directory (/) of the Linux file system. All user data, programs, log files, and configuration files are contained in this single disk partition.Even though this is the default partitioning proposal made by most Linux distributions during installation, you should consider creating more partitions than the two or three that are created by default.
To understand why we do this, you need to first understand that Linux uses a single file system structure to represent all of the storage space available to the Linux system. For example, in Figure 5-7, an extra partition (/dev/sda3) has been created on the first SATA hard disk drive in the system (/dev/sda), which is mounted at the /home directory.When you navigate through the Linux file system hierarchy and double-click the /home directory, you are actually redirected to a different partition on the hard drive. If you had multiple hard drives in the system, you could even put the partition mounted in /home on a completely different hard drive. The partitioning is completely transparent to the end user.I encourage you, when planning your Linux partitions, to create many partitions on your hard drives. Doing this can add a degree of fault tolerance to your Linux system. Problems encountered in one partition are isolated from the other partitions in the system.
For example, suppose you used the default partitioning proposal when installing Linux and had your entire file system mounted at the root directory (/). If a user were to consume all of the available space on the partition by copying huge files to his home directory in /home, it could cause the entire system to crash because the operating system would no longer be able to write critical system files to disk
No comments:
Post a Comment