</code>
dev/sda6 4.9G 4.1G 512M 90% / /dev/sda2 9.7G 8.6G 558M 95% /apps /dev/sda1 494M 23M 446M 5% /boot none 4.0G 0 4.0G 0% /dev/shm /dev/sda11 19G 16G 2.2G 89% /u02 /dev/sda3 9.7G 7.3G 1.9G 80% /products /dev/sda9 2.0G 38M 1.9G 2% /tmp /dev/sda5 6.8G 4.4G 2.1G 69% /usr /dev/sda7 4.0G 2.6G 1.3G 68% /var /dev/sda10 9.2G 213M 8.6G 3% /svn
Table 2-2: Example Partition Configuration for a Linux File Server
Filesystem | Size (MB) | Mounted Directory |
---|---|---|
/dev/sda1 | 100 | /boot |
/dev/sda2 | 6000 | / |
/dev/sda5 | 4000 | /var |
/dev/sda6 | 8000 | /usr |
/dev/sda7 | 2000 | Swap space |
/dev/sda8 | 20000 | /home |
/dev/sda9 | 6000 | /home/shared |
Linux uses the swap space configured on one or more hard drive partitions to store infrequently used programs and data. Swap space can extend the amount of effective RAM on your system. However, if you don't have enough actual RAM, Linux may use the swap space on your hard drive as virtual memory for currently running programs. Because hard drive access can be 1/1,000,000th the speed of RAM, this can cause significant performance problems.
But you can't just buy extra RAM and eliminate swap space. Linux moves infrequently used programs and data to swap space even if you have gigabytes of RAM.
Normally, Linux (on a 32-bit Intel-style computer) can use a maximum 4GB of swap space in partitions no larger than 2GB. This 4GB can be spread over a maximum of eight partitions. The typical rule of thumb suggests that swap space should be two to three times the amount of RAM. However, at larger amounts of RAM, the amount of swap space that you need is debatable.
The way Red Hat assigns default swap space is based on the amount of RAM on your system and the space available in your hard drive. As discussed earlier, graphical installations of RHEL require at least 192MB of RAM. If your system has the minimum amount of RAM and there's room available on your hard drives, Anaconda configures a swap partition of twice this size (384MB). For Intel 32-bit systems, Red Hat suggests a swap partition at least equal to the amount of RAM on your system. But it isn't required; I have a couple of 2GB systems for which 1GB of swap space is more than sufficient.
In any case, you want to make the swap space you create as efficient as possible. Swap partitions near the front of a hard disk, thus on a primary partition, have faster access times. Swap partitions on different hard drives attached to separate disk controllers give Linux flexibility as to where to send swap data. Linux can start a program through one hard drive controller and move files to and from swap space on a separate hard drive controller simultaneously.