To Partition or Not to Partition

Published on September 7, 2021 at 6:58 am by LEW

Introduction

Partitioning drives is a step that comes up in many Linux installations. However it is available in all Operating Systems (OS). Everyone is partitioning their drives, whether they know it or not. However, the question of partitioning is only relevant when doing something non standard. There are reasons to partition a drive, just as there are also reasons for not doing it. There are also a lot of misconceptions concerning partitioning.

Note that when I refer to drives, this can refer to Solid State Drives, Mechanical Hard Drives, or even a USB storage devices.

I am going to devote some space to drive partitioning, and if it is something you may want to take advantage of. I will be staying away from the actual mechanics of how a drive gets partitioned, mainly because it is not relevant to discussing the advantages and disadvantages of partitioning. Depending on the drive media type the actual mechanics will differ significantly. So no discussion about cylinders, sectors, or abstraction layers. We will visualize each of your drives as a continuous storage space. Partitioning is what we do with that storage space.

Partitioning is part of making a drive usable. A drive can not be formatted until it has been partitioned. Each partition takes up a part of the drives total storage capacity. Each partition, to an extent, acts as an independent drive. Actual creation of partitions on various OS’s will not be covered here. Instead we will discuss why you may or may not want additional partitions.

The partitions on any one drive will also depend on the drive type also. Either Legacy or EFI. Legacy vs EFI is covered elsewhere, and not in scope for this article.

Everyone Partitions

A simple example of partitioning is a drive used with a Windows based Operating System (OS). You may think C: is your hard drive, but it is actually a partition residing on your hard drive.

Whether the C: partition takes up the whole drive or not is the question. Under Windows, there will be several partitions on your drive. Your C: partition may indeed take up most of the space on your drive, but you will also find a recovery partition. If you are using a recent computer, you will likely find a EFI partition. Depending on the manufacturer, you may also find they have added a partition to your drive. These extra partitions do not have drive letters assigned, so they are not visible to normal usage.

Turning to Linux based systems, drives are identified in the “/dev” directory. The first drive would be labeled sda, and the first partition on that drive would be sda1. A second partition would be sda2. While on an additional drive, it would be sdb, sdb1, and sdb2 respectively.

Viewing Partitions

Most OS’s have some type of disk management application installed. Using this type of software, you can see the partition structure on your current drives.

For example if I run the Windows Disk Manager, I can see my first drive (drive 0) has a EFI partition, a Recovery partition, and an NTFS partition. The NTFS partition is the only partition with a drive letter, so it is the only one visible in the file manager.

Whats Good About Multiple Partitions

One of the most common reasons for a user to create additional partitions is adding a data partition. Doing so allows you to separate user data from the OS. One of the reasons for doing this is if your operating system crashes (say during a failed software update) requiring a reformat and reload, your personal data is still intact on its own partition.

Another advantage of a data partition is backups. With data separate from OS, the entire data partition can easily be backed up.

Another advantage to partitioning is to be able to boot after a run away process, or a virus/attack takes up all available space on a partition. An example would be a web or gaming server exposed to the internet getting hacked. Another example would be badly coded software (games in particular). If your web server or game is using a different partition, then you will still be able to boot. If this happens to the partition the OS is on, you may not be able to start up.

Whats Bad About Multiple Partitions

Probably the number one issue most of us will run into with using multiple partitions is wasted disk space. Partitioning, by its very nature will fragment free disk space across multiple partitions. Free disk space in one partition cannot be used by another partition.

Whats Questionable About Multiple Partitions

There are a couple of items that can be either bad or good about partitioning, depending on disk usage, disk type, and file system. These can all be somewhat abstract, but I am listing them here for completeness.

File Access Time can be either negatively or positively impacted by partitioning. Accessing files across multiple partitions can cause mechanical read/write heads to jump around a lot, increasing both access time and mechanical wear. This is not an issue with Solid State Drives (SSD) as they have no mechanical read/write heads.

Disk Maintenance can be quicker on smaller sized partitions, but will need to be done for each partition.

While partitioning can offer some protection from an OS failure, it cannot protect you from a drive failure. In this case every partition on the failed drive might be lost.

Examples of Partitioning

On my personal Laptop, I usually set up two partitions for use (technically there are more including EFI, recovery, swap, etc.). On a Windows based computer I would install the operating system on partition C:, and partition D: would be a data partition. Then I would point my data folders (like Music, Documents, Videos, etc.) in my user directory to a folder on my data drive (D:). This can be done by right clicking on some of your home directory folders and going to the location tab of properties.

As another example, I have a Linux based web server with six partitions; EFI partition, Swap partition, root (OS) partition, home partition, var partition and tmp partition. Root and home are used as above. The web server resides in the root partition, while its working directory and data directory reside in the var partition. The tmp partition holds all temporary files generated by the OS and web server. If either the tmp or var partitions get filed up from malicious activity, I can still boot into the operating system, and clear the garbage files filling tmp and var.

Conclusion

To partition or not to partition is up to you. Just be aware of the issues you might encounter. The biggest one for most normal users will be effective utilization of drive space. However you may be running special purpose computers that could really benefit from drive partitioning.

The only question not really addressed is partition sizes, and that will be very dependent on your operating system and what you are doing.

Add New Comment

Your email address will not be published. Required fields are marked *