Partitioning guidelines

When installing Linux on a new system, users are frequently confronted with the need to partition their available hard drive space. Some newer distributions make partitioning choices automatically for you, and allow you to override those choices if you wish. Others require that you use tools like fdisk or cfdisk.

= Recommendation =

Do not build up additional complexity by dividing your hard disk into partitions - one partition for all folders works best. For example, if you set a fixed space for your /home directory, it can happen that this partition runs full and - although you still have plenty of space on your hard disk, you are at the space limit for /home. So, use one partition for all your folders. To be more flexible with swap space, use a swap file.

The Root partition
The root of the filesystem is called "/". Typically, it does not require much space, and will probably be one of the smallest partitions on your system. One or two gigabytes is probably enough. Except, of course, if you follow the above recommendation and the root filesystem contains all the data that would otherwise go in the partitions mentioned below, in which case the root filesystem may encompass your entire hard drive.

/usr
The /usr filesystem is where almost every program, library or data-file on your system will live. It needs to be correspondingly big. 6-15 gigabytes is adequate for most applications, even if you load your system down with package after package.

Swap space
Almost every Linux system will need swap space. The classic piece of advice is "swap should be double the amount of RAM you have", though this is not a rigid guideline. Another guideline is to have at least 1x your RAM size, but this also isn't a fixed, absolute requirement (this used to be necessary for linux, but not anymore for recent versions). It depends mainly on what applications you want to run. Applications like video/movie editing, 3d rendering, large image editing, database servers and web application servers can use a lot of memory and if you don't have that as RAM, it will need a large swap space.

A good way to decide the size, is to just try and see. Pick a size (it is usually easier to reduce the swap size after-wards, so aim high) and run your 'normal' workload for a while and see how much swap is used (See Memory diagnostic tools). You can then adjust/resize the partitions or re-partition completely.

To optimize for speed, it is advisable to put the swap partition on a different hard disk (if you have one) instead of on the main hard disk with the OS on it. It is also possible to spread the swap space over multiple hard disks, this can also increase the speed. Linux can handle multiple swap spaces, and each swap space can have a priority (pri=somenumber in fstab, also see swapon command).

Other filesystems
If you have several disks, or choose to use logical partitions, you may want to add additional partitions. Operators of multi-user systems in particular may have a use for some or all of the following. You should evaluate how much usage you expect your system to get, and size these partitions accordingly.

/boot
At one time, the venerable LILO boot-loader required that it find its necessary files within the first 1024 cylinders of the disk it was booting from. People would typically create a small (10 megabyte) partition for this purpose. This restriction is not a problem with recent versions of LILO and its presumed successor GRUB.

/var
Many large systems have hundreds or thousands of email accounts. It is often desirable to put the mail spool directory (usually, the place where email inboxes reside in the filesystem) onto a separate partition. Creating a separate partition for /var lets the system administrator keep a full email box from disrupting the rest of his system.

/home
On large multiuser systems where users may be storing a lot of data (such as Web pages), creating a separate partition for home directories is useful.

On a single-user system where you have a lot of disk space left over, you might also choose to create a /home partition for your home directory, and use the remaining space for it.

Special partitions
People who collect home movies may want a /media partition; likewise, people supporting large CVS projects may want a /cvs partition.