If you are reading this chapter, it means that you have decided on an expert installation of Mandrake Linux, which will require you to understand partitioning. Or you are simply curious and that's OK too :-)
This section provides a complete description of the PC partitioning scheme. It is only useful to you if you intend to manually set the partitions of your hard drive. If you do not understand what we are talking about, you may safely ignore this section; the installer can do everything automagically for you.
To simplify, a hard disk is merely a sequence of sectors. A sector is the smallest data unit on a hard disk, and its size is typically 512 bytes. The sectors on a hard disk of ( n ) sectors are numbered from ( 0 ) to ( n-1 ).
The use of multiple partitions enables you to create many virtual hard drives inside your real physical drive. This has many advantages:
Different operating systems use different disk structures (called file systems); this is the case for Windows and GNU/Linux. Having multiple partitions on a hard drives allows you to install various operating systems on the same physical drive.
For performance reasons, a single operating system may prefer different drives with different file-systems on them because they are used for completely different things. It is the case for GNU/Linux which requires a second partition called "swap" and used for virtual memory.
Finally, it may prove very useful to separate the different parts of your OS into different partitions, even if they use the same file-system. In the most simple configuration, you can split your files into two partitions, one for your personal data, and another for programs. This allows you to update your OS, completely erasing the programs partition while keeping the data partition safe.
Physical errors on a hard disk are generally located at adjacent sectors and not scattered among the disk. Distributing your files into different partitions will limit data loss in case of hard disk physical damages.
Normally the partition type specifies the file-system which the partition is supposed to contain. Each operating system recognizes some of the types, but not others. See the chapter about GNU/Linux file-systems in the Reference Manual for more information.
Having only two partitions: one for the swap space, the other for the files[1].
![]() | The rule of thumb for the swap partition size is to choose double of the size of your RAM memory. However for large memory configurations (>512 MB), this rule is not valid, and smaller sizes are preferred. |
Choose to separate data from programs. To be even more efficient, one usually defines a third partition called the "root" and labelled as /. It will handle the programs necessary to startup your system and the basic maintenance programs.
So we could define four partitions:
A partition of type swap, which is roughly equivalent to twice the memory size.
It is the most important partition. It not only contains the most important data and programs for the system, but will also act as a mount point for other partitions.
The needs of the root partition in terms of size are very limited, 300MB is generally enough. However, if you plan to install commercial applications, that usually reside in /opt, you will need to increase that size. Another option is to create a separate partition for /opt.
Most packages install most of their executables and data files under /usr. The advantage of having it on a separate partition is that you can share it easily with other machines over a network.
The size depends on the packages you wish to install. It varies from 100MB for a lightweight installation to several GB for a full install. A compromise of one or two GB (depending on your disk size) generally suffices.
Here are kept the personal directories for all the users hosted on the machine. It also generally hosts the directories served by HTTP or FTP (respectively for web browsing and file transfers).
Here the partition size depends on the number of users (or services) hosted and their needs.
When setting up your machine for specific uses such as a web server or a firewall, the needs are radically different than for a standard desktop machine. For example, a FTP server will probably need a big separate partition for /var/ftp, while the /usr will be relatively small. For such situations, you are encouraged to carefully think about your needs before even beginning the install.
![]() | If after a period of time using your system, you notice that you should have chosen different sizes and partitions, it is possible to resize most partitions without the need to reinstall your system, it is even generally data-safe. See Managing Your Partitions. With a little bit of practice, you will even be able to move a crowded partition to another brand new hard drive. But that's another story... |
[1] | the file system used currently for GNU/Linux files is called ext2 |