10 reasons for using multiple partitions

Off the Beat: Bruce Byfield's Blog

Apr 25, 2016 GMT
Bruce Byfield

Most Linux beginners content themselves with a single system partition and a swap drive. However, as they gain experience, they learn the advantages of dividing the system across several partitions.

These advantages are changing with the technology. Old reasons for partitioning are becoming obsolete, and new ones emerging along with solid state drives and UEFI. Still, there are at least ten reasons for partitioning hard drives:

1. Repairing partitions:
When a drive is not shut down properly on a journaled system, you may have to repair it by running the fsck command manually from a live DVD. If the problem is not with the root partition or /var, you can often boot in single user mode, unmount the partition, run fsck, and reboot, all of which is much faster than starting up a live DVD.

2. Reinstalling
When reinstalling becomes necessary, you can be up and running faster if your /home directory is on a separate partition. Just make sure that the partition is not reformatted during re-installation, and that the partition is mounted as /home during re-installation.

3. Preventing overflow of temporary files
The /tmp partition can fill up -- not just from an attack, but simply through everyday use. In fact, you might want to want to run a weekly cronjob to clean it out.

If you have a single partition, when /tmp is full, it can consume all free space and cripple or crash your system. If /tmp has a separate partition, it can still cause problems when full, but you may still be able to save your work, and you can certainly make repairs more easily.

4. Reducing the time for partition checks
During bootup, Journaled file systems check filesystems if they were not properly shutdown, or every thirty or so boots in order to check their integrity. If you have a two or three terabyte partition, this check can take as long as five minutes. By contrast, checking several smaller partitions is much faster.

5. Using UEFI
Many Linux users simply turn off secure boot. However, if you are using multiple operating systems under secure boot, you also need to install Linux under it. In that case, you require a separate /boot partition, formatted with its own unique filesystem. In modern distributions, the installer will usually take care of the formatting for you.

Installing a software RAID0 (stripe) system also requires a separate /boot partition.

6. Multiple booting
Thanks to the bootloader, Linux supports multiple distributions or operating systems on the same machine. Virtual filesystems have perhaps made multiple booting less common, but it remains one of the main reasons to use multiple partitions. So long as you remember to install Windows first, the arrangement is generally stable.

7. Creating an Emergency Partition
Laptops and many off-the shelf computers ship with recovery partitions. If yours does not have one, you can easily create a custom recovery by adding a distribution like Knoppix to its own partition. Although many recovery tools can be installed to a DVD or flashdrive, one on the hard drive will be able to do repairs more quickly.

8. Using solid state drives:
Today, top of the line solid state drives (SDDs) have five or ten year warranties, and the earlier fears of shortening their life spans with unnecessary writes are less relevant than when they first became available. In fact, such concerns may be obsolete.

All the same, if you want to help reduce the use of an SDD, place partitions like /tmp, /var, and swap that are likely to have files that are constantly changing and being deleted elsewhere.

If you are well-stocked with RAM, these partitions can be placed in a RAM drive. An alternative is to put the core system on an SDD, and these files on a traditional mechanical drive, along with /home and other general storage partitions. Since two or three terabyte SDDs are expensive, many users are currently mixing SSDs and mechanical drives anyway.

9. Finding files and directories
On mechanical drives, smaller partitions mean that searches are faster. SDDs are already many times faster than mechanical drives, so smaller partitions make less of a difference to search -- probably too little to detect, although information is lacking.

10. Sharing resources
When you have multiple booting or several users on the same machine, you may want to share resources by placing them on a separate partition. Traditionally, these non-standard partitions are mounted as a sub-directory of /mnt. To function, these partitions usually need relaxed permissions, so as a basic security precaution, the permissions on other partitions should be as tight as possible.

Taking control
You don't need to use multiple partitions. You can even replace the swap partition with a swap file. However, sooner or later, you are likely to come across a situation in which multiple partitions mean increased efficiency.
When that happens -- and it almost surely will as you learn about Linux -- you can download a tool like GParted, and resize partitions as you want. You might want to search the Internet for various suggestions for partitions first. If you installed with a single system partition, the conversion will be slow, but the result should be worth the effort and time.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More