what is a disk partition and why you should partition your disk?

Disk Partitions are logical sections or volumes on the same hard disk or a data storage device that act as separate disks for all practical purposes. Each of these partitions maintains their own address tables (or Master File Table) and file system information.

Each disk device needs to have at least one partition to be useable, but it is very much possible to create many different partitions.

Considerations for creating disk partitions

Before creating partitions, you need to take into consideration some of the factors that affect why and how you would create partitions.

Operating System (OS) considerations: Some operating systems impose restrictions on the partitions that you can have or need to have. It might require that the boot or kernel files exist in a separate partition that the user data files. Also, the swap size is usually separated out into the partition by its own.

Overall Size of the disk: Make sure that the disk you are partitioning have enough and more space in it.

The size of the individual partitions:  Map out the size of each individual partition that you want to have and make sure that you allocate enough space to each of them. Plan ahead of time for the scalability of the partitions as the number of files and the size files increases over time in most situations.

GParted Showing Disk Partitions on a Linux System

Advantages of multiple disk partitions

There are several advantages of having partitions on your hard drive.

Faster disk access: Careful planning might yield you a faster speed. You will be able create different file system types that best suits the type of files that you will store in that particular disk partition. Smaller or an optimum sized partition will increase lookup times in the address tables by keeping the size of the tables lower.

Prevents Data overflow: Some file types like cache files and log files can grow to large sizes. Keeping them separate from the system files and user data files will ensure that these files do not cause the entire disk to run out of space.

Isolating Data Corruption: It is possible for the sectors on the drive to go bad. It is also possible for a rogue or experimental software to corrupt data. In such cases, partitions help by isolating the data corruption to a limited scale.

Separate area for swap/paging: Usually the swap size uses a different file system type will need to be in a separate partition by itself.

Logical separation of data: This allows you to keep different file types separate. The system files can be maintained separately from the user files. Even within the user files, you could keep the media files separated from the software specific files or text files. Even though the backup files should be kept on a separate disk altogether, it  can be kept in a different partition if a secondary drive is not available.

Though there are more advantages to partitioning, there are also some disadvantages with having multiple partitions. Most of these disadvantages occur mostly because of proper planning ahead before partitioning.

Disadvantages of multiple disk partitions

Lower disk space: Partitioning makes the disks smaller. If you do not have enough space in these partitions, then you might not be able to save (or download) large files even though you have enough (total) free space left in the disk.

Multiple address tables: The faster access speed due to smaller address table can be negated by having too many partitions and hence too many address tables.

Increased disk fragmentation: Smaller disks also tend to have higher disk fragmentation as the size of available contiguous free space is limited and smaller than a disk/partition of larger size.

Slower speeds between partitions: As partitions maintain different address tables, the files can only be moved and copied by copying the actual contents in sectors rather than the faster address table manipulation that can be done within the same address table.

Linux has some restrictions when it comes to disk partitioning. Linux allows you to have only 4 (or less) primary partitions. In order to make more partitions, you will have to create partitions by sub-dividing one of the primary partitions. Only one of the primary partition can be sub-divided in this fashion.