When you're doing Linux disk partitioning (during or after installing Linux) you will likely run into situations where you can not create partitions – and can not do other tasks that you'd like to do with partitions!
This is when you need to understand the Linux hard disk partitioning "rules" described below.
Linux System Admin Training Tips: Keep in mind that the "rules" below apply to using the Linux fdisk command, which is the most commonly used disk partitioning utility. You may be able to "break" these rules with other hard disk partitioning utilities.
"Setting Up" Linux Hard Disk Partitions
You can "set up" and configure your Linux partitions while using the installation routine of most Linux distributions – and also by using the Linux fdisk and parted commands – and some other partitioning commands.
Also, as a Linux System Administrator, you will also need to manage (create, delete, and modify) partitions on existing Linux systems (after the OS has been installed). To do this, you use the fdisk command / utility or the parted command / utility – and there are also other disk partitioning commands and utilities.
There are some Linux hard disk partition "types", such as primary, extended and logical – and there are also strict "rules" about using these Linux partition types.
Linux Primary Partitions
The disk partitioning utility in a Linux installation routine and the fdisk command (and other disk partitioning commands) can create a maximum of four Primary partitions per hard disk drive.
If you need more than four hard disk partitions, you need to create at least one Extended partition and then create one or more Logical partitions in the Extended partition.
To be able to create an Extended partition on a hard disk that already has four Primary partitions, you need to delete one of the primary Partitions and then create the Extended partition. So, you can have a maximum of three Primary partitions if you are creating an Extended partition on a Linux hard disk.
Linux Extended Partitions
A Linux hard disk must have at least one Primary partition before it can have an Extendeded partition.
fdisk can not create more than one Extended partition per drive. To be able to use the disk space in an Extended partition, it must have at least one Logical partition (within the Extended partition).
Linux Logical Partitions
Extended partitions contain one or more Logical partitions. An Extended partition is not accessed directly. It is accessed via one or more Logical partitions within the Extended partition. If a hard disk has an Extended partition, then it has at least one Logical partition in that partition.
The maximum number of Primary partitions that fdisk can create is four and the maximum number of Extended partitions that it can create is one.
Remember, you must have at least one Primary partition before you can have an Extended partition. You can only have one Extended partition and the maximum number of the combination of Primary and Extended partitions is four.
The Linux disk partitioning concepts covered here apply to: Debian, Red Hat, Fedora, Ubuntu, Slackware, SUSE, openSUSE – and ALL other Linux distributions.