Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maximum number of primary partitions?

I am reading about partitioning in Linux, and I found out that it is not possible to create an "infinite" number of primary partitions, as I had thought. So, why is the maximum number of primary (non-logical) physical partitions 4?

like image 233
user3289157 Avatar asked Dec 07 '22 02:12

user3289157


2 Answers

This is not a Linux restriction, it's a restriction of the MBR partition layout. The original MBR spec fit the partition layout into a single 512 byte sector, and there was only room to define four "primary" partitions there. Various nonstandard extensions exist allowing more than four partitions in MBR, but the classical spec only allotted for four.

"Extended boot records" are a fairly common way of extending MBR past its first four primary partitions. One partition entry in the MBR partition table is actually a pointer to another partition table. This second partition table can have a pointer into a third, etc etc, giving, in principle, an unlimited number of extended partitions. However, since these extended partitions are not defined inside the main MBR, they are not primary partitions, and you typically cannot boot from them.

Switching to a more modern standard, such as GPT, removes this restriction -- but may not be compatible with some motherboards and operating systems. For example, Windows does not support EFI, the modern spec underlying GPT, unless you are running a 64-bit operating system.

like image 68
Josh Watzman Avatar answered Jan 08 '23 15:01

Josh Watzman


Its 4. It is a limitation of MBR.

If you want more partitions, you can create three primary and one extended partition.

Inside extended partition, you can create as many logical partitions.

Hope it helps.

like image 26
Randeep Avatar answered Jan 08 '23 14:01

Randeep