Best Hard Disk Partitioning Scheme under Linux
Before partitioning a hard disk, you should first figure out what work the computer will be doing and how large the hard disk is, and also consider the following questions:
The first point, and also the most important one, is to know which version of LILO is currently installed, because LILO 2.21 and earlier versions have hard disk size limits. If LILO is installed beyond cylinder 1023, that is, beyond the 8G area, LILO will not boot. But on some machines with older BIOSes, LINUX still cannot break through the 1024-cylinder limit, so these BIOSes cannot recognize hard disk space beyond 1024.
Other issues that also need to be considered are:
· Whether to restrict the amount of disk space users can use?
· What software needs to be installed in the system?
· How large should the swap partition be?
· Does the system have multiple hard disks?
Below, we give some suggestions on partitioning according to the different nature of the system's work. Of course, depending on the actual situation, the partition sizes below can also be adjusted flexibly as long as the system's work requirements are met.
Partitioning scheme for a basic workstation
Assume the system's hard disk size is 10G.
/boot 20M
Swap 128M
/root 9.85G
Creating a 20M /boot partition is to avoid placing the system kernel files beyond cylinder 1024. If /boot is made a subdirectory of the root partition, the kernel files may be installed anywhere in the root partition. Since the hard disk size exceeds 8G, problems may occur at boot time. It is recommended to set the swap partition size to twice the memory size; here we assume the system memory is 64M. Finally, we assign all remaining hard disk space to the root partition.
Basic server hard disk partitioning scheme for Red Hat Linux 6.2 and earlier versions
Here we assume the server only provides a few common services, such as WWW service and FTP service, and the number of users logging in via telnet is very small. Assume its hard disk size is 25G.
/boot 20M
Swap 128M
/ 10G
/home 13G
/var 2G
Create a 20M /boot partition at the very front of the hard disk, for the same reason as above. The swap partition is also 128M because the memory size is 64M.
/ , that is, setting the root partition to 10G, is because it contains a /usr directory, and this directory may take up a lot of hard disk space, especially when X Server is installed and graphical interface applications are run.
The /home partition is the largest partition on the hard disk, which seems somewhat contradictory to our assumption that the system has few users. In fact, there are indeed not many user directories under /home, but in Red Hat 6.2 and earlier versions, the Apache server and the wu-ftpd FTP server were placed in the /home/httpd and /home/ftp directories. So there is a reason for this partition being so large.
Finally, the /var directory alone occupies one partition, because all system logs are written under the /var/log directory, which will take up a large amount of hard disk space. If the system logs are recorded in great detail, the entire directory may soon be filled, causing the system to become sluggish. Of course, this can be avoided by modifying the log configuration through the system logging background daemon syslogd.
Basic server partitioning scheme for Red Hat 7 and later versions
This situation is the same as the previous scheme, except that the LINUX version is Red Hat 7.0 or above.
/boot 20M
Swap 128M
/ 10G
/var 15G
Unlike RedHat6, in RedHat7 the HTTP service and FTP service directories are now located in /var/www/ and /var/ftp/, so it is not hard to understand why the /var partition is as large as 15G.
Partitioning scheme for a multi-user server
In this kind of server system, multiple users remotely access the system at the same time through telnet, ssh, rlogin, or other methods. The system has three 35G hard drives, with a total of 105G of disk space. RAID 5 technology is used in the system for data redundancy. In this case, the administrator must allocate disk space for each user. For RedHat 6.2 and earlier versions, the partitions are as follows:
Disk 1:
/boot 20M
/ 4G
/var 3GB
/home 27.98G
Disk 2:
swap 20MB
/ 4GB
/var 3GB
/home 27.98GB
Disk 3:
swap 20MB
/ 4GB
/var 3GB
/home 27.98GB
The reason for partitioning this way: first, the 20M /boot partition on Disk1 does not belong to any RAID array, otherwise if you put /boot into a RAID array, you will not be able to upgrade the system kernel later.
For ease of management, 20M swap partitions are created on the other two hard disks. This kind of server generally has more than 1G of memory, so the size of the swap partition is not a problem. If the swap partition is increased, RAID partition space will be reduced, so 20M is enough. The RAID partition groupings are as follows:
· 1-A, 2-A, and 3-A together form an 8G RAID 5 drive, mounted as the / root directory.
· 1-B, 2-B, and 3-B form a 6GB RAID 5 drive, used as the /var directory.
· 1-C, 2-C, and 3-C form a 55.96GB RAID 5 drive, used as /home.
This allocation scheme gives a total of 55.96G of space to all users as well as Apache and FTP services, and 6G under /var is used for logs and mail, which is enough space.
If Red Hat 7 or above is installed, more space should be given to the /var partition, because it also stores the two directories for WEB and FTP services.
Before partitioning a hard disk, you should first figure out what work the computer will be doing and how large the hard disk is, and also consider the following questions:
The first point, and also the most important one, is to know which version of LILO is currently installed, because LILO 2.21 and earlier versions have hard disk size limits. If LILO is installed beyond cylinder 1023, that is, beyond the 8G area, LILO will not boot. But on some machines with older BIOSes, LINUX still cannot break through the 1024-cylinder limit, so these BIOSes cannot recognize hard disk space beyond 1024.
Other issues that also need to be considered are:
· Whether to restrict the amount of disk space users can use?
· What software needs to be installed in the system?
· How large should the swap partition be?
· Does the system have multiple hard disks?
Below, we give some suggestions on partitioning according to the different nature of the system's work. Of course, depending on the actual situation, the partition sizes below can also be adjusted flexibly as long as the system's work requirements are met.
Partitioning scheme for a basic workstation
Assume the system's hard disk size is 10G.
/boot 20M
Swap 128M
/root 9.85G
Creating a 20M /boot partition is to avoid placing the system kernel files beyond cylinder 1024. If /boot is made a subdirectory of the root partition, the kernel files may be installed anywhere in the root partition. Since the hard disk size exceeds 8G, problems may occur at boot time. It is recommended to set the swap partition size to twice the memory size; here we assume the system memory is 64M. Finally, we assign all remaining hard disk space to the root partition.
Basic server hard disk partitioning scheme for Red Hat Linux 6.2 and earlier versions
Here we assume the server only provides a few common services, such as WWW service and FTP service, and the number of users logging in via telnet is very small. Assume its hard disk size is 25G.
/boot 20M
Swap 128M
/ 10G
/home 13G
/var 2G
Create a 20M /boot partition at the very front of the hard disk, for the same reason as above. The swap partition is also 128M because the memory size is 64M.
/ , that is, setting the root partition to 10G, is because it contains a /usr directory, and this directory may take up a lot of hard disk space, especially when X Server is installed and graphical interface applications are run.
The /home partition is the largest partition on the hard disk, which seems somewhat contradictory to our assumption that the system has few users. In fact, there are indeed not many user directories under /home, but in Red Hat 6.2 and earlier versions, the Apache server and the wu-ftpd FTP server were placed in the /home/httpd and /home/ftp directories. So there is a reason for this partition being so large.
Finally, the /var directory alone occupies one partition, because all system logs are written under the /var/log directory, which will take up a large amount of hard disk space. If the system logs are recorded in great detail, the entire directory may soon be filled, causing the system to become sluggish. Of course, this can be avoided by modifying the log configuration through the system logging background daemon syslogd.
Basic server partitioning scheme for Red Hat 7 and later versions
This situation is the same as the previous scheme, except that the LINUX version is Red Hat 7.0 or above.
/boot 20M
Swap 128M
/ 10G
/var 15G
Unlike RedHat6, in RedHat7 the HTTP service and FTP service directories are now located in /var/www/ and /var/ftp/, so it is not hard to understand why the /var partition is as large as 15G.
Partitioning scheme for a multi-user server
In this kind of server system, multiple users remotely access the system at the same time through telnet, ssh, rlogin, or other methods. The system has three 35G hard drives, with a total of 105G of disk space. RAID 5 technology is used in the system for data redundancy. In this case, the administrator must allocate disk space for each user. For RedHat 6.2 and earlier versions, the partitions are as follows:
Disk 1:
/boot 20M
/ 4G
/var 3GB
/home 27.98G
Disk 2:
swap 20MB
/ 4GB
/var 3GB
/home 27.98GB
Disk 3:
swap 20MB
/ 4GB
/var 3GB
/home 27.98GB
The reason for partitioning this way: first, the 20M /boot partition on Disk1 does not belong to any RAID array, otherwise if you put /boot into a RAID array, you will not be able to upgrade the system kernel later.
For ease of management, 20M swap partitions are created on the other two hard disks. This kind of server generally has more than 1G of memory, so the size of the swap partition is not a problem. If the swap partition is increased, RAID partition space will be reduced, so 20M is enough. The RAID partition groupings are as follows:
· 1-A, 2-A, and 3-A together form an 8G RAID 5 drive, mounted as the / root directory.
· 1-B, 2-B, and 3-B form a 6GB RAID 5 drive, used as the /var directory.
· 1-C, 2-C, and 3-C form a 55.96GB RAID 5 drive, used as /home.
This allocation scheme gives a total of 55.96G of space to all users as well as Apache and FTP services, and 6G under /var is used for logs and mail, which is enough space.
If Red Hat 7 or above is installed, more space should be given to the /var partition, because it also stores the two directories for WEB and FTP services.
我完全同意设想建立DOS组织“DOS联盟” ,也就是说和Wengier、以及“起步”站长莫老师等DOS战友一起来建立这个“DOS联盟”,以发展我国自主OS(操作系统)的高度去完成我们共同的愿望。
------党委书记
------党委书记

