中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-26 00:07
47,812 topics / 349,910 posts / today 0 new / 48,264 members
其它操作系统综合讨论区 » Best Hard Disk Partitioning Scheme under Linux [Repost]
Printable Version  1,174 / 1
Floor1 党委书记 Posted 2003-04-16 00:00
高级用户 Posts 217 Credits 912 From 广东
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.
Floor2 党委书记 Posted 2003-04-16 00:00
高级用户 Posts 217 Credits 912 From 广东
How to install Linux on a large hard disk

License:
This document is published under the DGPL. Anyone has the right to obtain, read,
repost, and publish this document free of charge,
but it may not be used for any form of commercial purpose.
This document is currently maintained by Rocky S. Lee. Anyone may
correct and amend any omissions or errors in it. The list of revisers will be placed
after the author's name in this document.
Brief description:
The purpose of this document is to explain how to use LILO (LInux LOader) to
properly and safely boot a Linux system installed on a hard disk
beyond 1024 cylinders (generally speaking, on a partition beyond 8 G).
If, after reading this document and following the method introduced here,
your Linux system fails to boot, or if you discover that the method described here is incorrect,
please contact the author.
A more technical version of this document will be published in the future. Linux users
interested in this document may please keep an eye on the following sites:
South China Kapok BBS bbs.gznet.edu.cn
China Linux Forum www.linuxforum.net
West Eighteen BBS bbs.x18.scut.edu.cn
Thanks to LinuxFarmer for the selfless help given in the creation of this document.
I. Raising the problem
In IBM 80x86 series PCs, when booting the system, hard disk addressing is performed by the basic input
output system (BIOS) according to the hard disk parameters stored in CMOS. After reading the hard disk's master
boot record (MBR, Main Boot Record), it either locates the corresponding
partition according to the data stored in it and completes booting the system in that partition
through the boot sector of that partition, or directly loads the information needed for booting from the
master boot partition to complete booting, such as LILO.
Due to historical reasons, many systems still use the old int 13h
interrupt call method to read hard disks when booting. In this interrupt, hard disk addressing appears
in a three-dimensional form, namely: cylinders, heads, sectors (CYLs, HEADs, SECs).
The cylinder number is stored in the high 10 bits of the CX register of the central processing unit
(CPU), occupying 10 binary bits. This
determines that its addressing range can only be 0 - 1023. As computer science develops and hard disk capacities
keep increasing, the limitations of this interrupt call have also become apparent.
That is why LILO cannot be used to boot a Linux system installed beyond cylinder 1024.
In fact, it is not completely impossible. There is another way to access the hard disk, namely
using linear address space, no longer using the three-dimensional addressing method of cylinders,
heads, and sectors. This is also the key to using
the LILO provided by the GNU / Linux system to boot an operating system installed anywhere on the hard disk.
II. Analysis of LILO
As the boot system of a mature operating system, LILO of course can use the above two
methods to boot systems on the hard disk. Usually it uses the common three-dimensional address space
to access the hard disk, while for some rather special systems it needs to use linear mode to access
the hard disk. At this time, parameters need to be added to the boot record corresponding to the system to be booted,
so that LILO can handle it correctly.
Generally, when installing a Linux system, when you reach the LILO installation step,
it asks whether you want to use linear mode. If so,
you need to fill in some parameters. But at this time the system
prompt asks whether you have some relatively special systems coexisting with Linux. This message actually misleads almost
everyone. (Note: the prompt message referred to here is from the RedHat Linux series and some improved
versions based on it.) In fact, at this time you can add some special parameters
to achieve some special functions. Exactly which parameters correspond to which functions is already beyond the scope
of this document. You can refer to the LILO manual
document, which has already been translated into Chinese by ZEO of the China Linux Forum. Here we are only interested in one
of those parameters, namely the hard disk's CHS parameters.
III. Solving the problem
If you have a large hard disk larger than 8 G, and you need to install Linux in a relatively far-back
location, you can choose linear mode during installation and add the hard disk parameters to it.
The hard disk parameters during installation can be written like this:
hd?=CYLs, HEADs, SECs
The uppercase letters need to be replaced with the actual hard disk parameters. These parameters can be found on the hard disk label,
or you can look at the line corresponding to LBA mode in the BIOS settings for hard disk parameters. The question mark depends on
the hard disk; in actual use, it can be one of the four letters a, b, c, d. For example:
hda=1869,63,255
These are the parameters of an IBM 15.2G hard disk.
Of course, after entering Linux, you can achieve the same purpose
by editing /etc/lilo.conf and adding this to the file, and then
running lilo once. Below is the content of my lilo.conf before adding the parameters:
boot = /dev/hda
map = /boot/map
install = /boot/boot.b
prompt
timeout = 50
image = /boot/vmlinuz
label = linux
root = /dev/hda1
initrd = /boot/initrd-2.2.12-20.img
read-only
After adding the parameters in linear mode, the format is as follows:
boot = /dev/hda
map = /boot/map
install = /boot/boot.b
prompt
linear <-----this line was added
timeout = 50
image = /boot/vmlinuz
label = linux
root = /dev/hda1
initrd = /boot/initrd-2.2.12-20.img
read-only
append = "hda=1869,63,255" <------this line was added
After changing it like this, save it, type the lilo command at the command prompt, and when Linux is started again,
LILO will boot the system in linear mode.
Apart from the difference in the way it addresses and locates on the hard disk,
it has no effect on other aspects.
The above is only an example, and actually has little practical use, but please note that the append
parameter is for
each system boot record, and must be placed below image or below other,
so that it
can take effect.
IV. Reference
LILO.CONF Chinese manual page
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023