Boot Drive:
If you want to boot your operating system from the drive you are about to partition, you will need:
Your boot partition ought to be a primary partition, not a logical partition. This will ease recovery in case of disaster, but it is not technically necessary. It must be of type 0x83 "Linux native". If you are using lilo, your boot partition must be contained within the first 1024 cylinders of the drive. (Typically, the boot partition need only contain the kernel image.)
If you have more than one boot partition (from other OSs, for example,) keep them all in the first 1024 cylinders (All DOS partitions must be within the first 1024). If you are using a means other than lilo loading your kernel (for example, a boot disk or the LOADLIN.EXE MS-DOS based Linux loader), the partition can be anywhere. See the Large-disk HOWTO for details.
Unless you swap to files you will need a dedicated swap partition. It must be of type 0x82 "Linux swap". It may be positioned anywhere on the disk (but see notes on placement). Either a primary or logical partition can be used for swap. More than one swap partition can exist on a drive. 8 total (across drives) are permitted. See notes on swap size.
A single primary partition must be used as a container (extended partition) for the logical partitions. The extended partition can go anywhere on the disk. The logical partitions must be contiguous, but needn't fill the extended partition.
/var | This fs contains spool directories such as those for mail and printing. In addition, it contains the error log directory. If your machine is a server and develops a chronic error, those msgs can fill the partition. Server computers ought to have /var in a different partition than /. |
/usr | This is where most executable binaries go. In addition, the kernel source tree goes here, and much documentation. |
/tmp | Some programs write temporary data files here. Usually, they are quite small. However, if you run computationally intensive jobs, like science or engineering applications, hundreds of megabytes could be required for brief periods of time. In this case, keep /tmp in a different partition than /. |
/home | This is where users home directories go. If you do not impose quotas on your users, this ought to be in its own partition. |
/boot | This is where your kernel images go. If you use MSDOS, which must go in the first 1024 cylinders, you need to at least get this partition in there in order to ensure that lilo can see it. If you have a drive larger than 1024 cylinders, making this your first partition guarantees that it will be visible to lilo. |
With ext2, partitioning decisions should be governed by backup considerations and to avoid external fragmentation from different file lifetimes.
Files have lifetimes. After a file has been created, it will
remain some time on the system and then be removed. File
lifetime varies greatly throughout the system and is partly
dependent on the pathname of the file. For example, files in
/bin
, /sbin
, /usr/sbin
, /usr/bin
and similar directories are
likely to have a very long lifetime: many months and above.
Files in /home
are likely to have a medium lifetime: several
weeks or so. File in /var
are usually short lived: Almost no
file in /var/spool/news
will remain longer than a few days,
files in /var/spool/lpd
measure their lifetime in minutes or
less.
For backup it is useful if the amount of daily backup is smaller than the capacity of a single backup medium. A daily backup can be a complete backup or an incremental backup.
You can decide to keep your partition sizes small enough that they fit completely onto one backup medium (choose daily full backups). In any case a partition should be small enough that its daily delta (all modified files) fits onto one backup medium (choose incremental backup and expect to change backup media for the weekly/monthly full dump - no unattended operation possible).
Your backup strategy depends on that decision.
When planning and buying disk space, remember to set aside a sufficient amount of money for backup! Unbackuped data is worthless! Data reproduction costs are much higher than backup costs for virtually everyone!
For performance it is useful to keep files of different
lifetimes on different partitions. This way the short lived
files on the news partition may be fragmented very heavily.
This has no impact on the performance of the /
or /home
partition.
If you have decided to use a dedicated swap partition, which is generally a Good Idea [tm], follow these guidelines for estimating its size:
So for a configuration with 16 MB RAM, no swap is needed for a
minimal configuration and more than 48 MB of swap are probably
useless. The exact amount of memory needed depends on the
application mix on the machine (what did you expect?).
Summary: Put your swap on a fast disk with many heads that is not busy doing other things. If you have multiple disks: Split swap and scatter it over all your disks or even different controllers.
Even better: Buy more RAM.