|
Tips on creating partitions |
|
A partition is a slice of a computer's hard drive. There can be many small slices, or one large slice (that takes the whole drive). Other operating systems may label their partition slices as C:, D:, E:, etc. In Linux, the partitions are labeled differently. Usually, a Linux system will have partitions named / (the 'root' partition), /var, /usr, swap, /home, and possibly /boot, /tmp, and so on. These partitions are explained below:
- /
Often referred to as the 'root' partition. Usually holds boot and configuration files, device and system information, temporary files and miscellaneous stuff. Can be small, usually 500MB is sufficient, but more may be needed if multiple kernels are to be installed.
- /var
The 'var' partition mainly holds system log files. It can also be used for spooling (print jobs, mail, faxes, whatever). yum usually stores updated software on the /var partition. Amanda is usually configured to write backup files to /var. Some default configurations use /var for database and Web files as well. Depending on usage, a size of 2~3GB is usually ok; more can be allocated if the mail spool, database or Web file requirements are unusually large, or if Amanda will be creating large backup files.
- /usr
The 'usr' (pronounced 'user') partition holds most all software that's installed on the computer. Any program that's run from the command line, launched from the Applications menu, or set to run as a daemon is usually found in /usr. Additionally, if you're inclined to compile your own code from source files, or download and install custom software that's not available through yum, you'll probably store the packages somewhere in /usr. Allocation of 10~25GB is usually sufficient.
- swap
The swap partition is used by the system as virtual RAM. When you run out of RAM, data in RAM are written to the swap partition for later use. This frees up space in RAM for other data. The swap partition should be at least as large as the amount of RAM you have, and double if feasible. However, a swap partition larger than 4GB is usually not practical, as explained below in the strategy section.
- /home
The 'home' partition is where most user-owned files are located. All users have their own directory on the /home partition that's used for downloading files (music, movies, pdf's, whatever), storing popped mail, documents, etc. Because of these requirements, the /home partition should be large (usually whatever is not already allocated to /, /var, /usr, and swap is given to /home).
- /boot
The 'boot' partition, if present, will hold the main boot image and any initial configuration files that are used when the computer boots up. The space requirements for these files are usually minimal (less than 50MB), therefore a /boot partition is usually not necessary and is considered part of the root partition.
- /tmp
The 'tmp' (pronounced 'temp') partition, if present, is where temporary files are written. It's usually accessible to all users of the system, so making a large /tmp partition is probably not a good idea. Space requirements are usually very small (less than 10MB), therefore a /tmp partition is usually not necessary and is considered part of the root partition.
|
|
|
A hard drive needs at least one partition to operate. The choice of whether to use more than one partition is up to each user. Read on.....
|
|
|
There are a few factors to consider when planning a partition strategy:
What will the computer be used for? If the computer is a server, you'll probably want a larger /var partition to handle the log files, mail spools, print/fax spools, database or Web files that may be stored there. If it will be a development machine, where you'll be compiling source code or hacking the kernel, you'll probably want a larger /usr partition. If you'll be using it to download six million music mp3's, you'll going to want /home to be as large as possible.
Will there be more than one hard drive? If so, you may want some of your partitions on separate hard drives.
How much RAM does the machine have? The swap partition should, at the least, be as large as the amount of RAM you have, but swap sizes larger than 4GB are usually not practical. In most cases, only a runaway application would use that much swap space (in other words, something is terribly wrong with that program you just ran). The more swap space you have, the longer it will take a runaway process to eat up your RAM, and you'll probably want a runaway process to halt sooner rather than later. There are exceptions to this, for example, a large, busy server may need more swap space than a simple single-user Desktop or Workstation.
What is the likelihood you'll be the victim of a mailbomb, or DoS attack? Millions of repeated Web page requests or huge emails can fill up a /var partition quickly. A larger /var partition can temporarily prevent a mailbomb or DoS attack from shutting your system log or mail daemon down. Not having a /var partition at all (making it part of the root partition, or using just one partition on your whole drive) can wreak havoc on your system. It's better to have a small 2GB partition fill up with log files or large email than to have an entire 500GB hard drive fill up. If that happened, where would you put the six million mp3's you were busy downloading?
How large is your tape backup? If you're trying to back up a 60GB /home partition on a 12GB tape backup, or Amanda will be managing backups for an 80GB drive and you allocated only 2GB on /var, you're most certainly going to be disappointed.
With these factors in mind, IGO typically recommends partitioning the hard drives pre-built servers as such:
|
| Partition Label |
Partition Size (in GB) |
| / |
1 |
| /var |
3-10 |
| /usr |
10-25 |
| swap |
1-4 |
| /home |
whatever's left |
|
|
When purchasing a pre-built system, IGO will allow you to specify any special partition requirements you may have before adding your selection to your shopping cart.
|
|
|
You can, but it is not recommended. Adjusting partition sizes on an existing filesystem is risky at best and can be catastrophic at worst. Having said that, there are utilities available for adjusting your partition sizes. Your Linux system probably already has GNU Parted installed, and Partition Magic, originally made by Symantec, supports Linux swap and ext3 partitions and can be purchased. Before attempting to resize your hard drive partitions, make sure you back up your system! If the resizing fails and crashes your hard drive, you'll be bumming without backups.
|
|
|
|