Meaning of hard disk drive software partitions?

Solution 1:

The "MS-DOS" partitioning scheme is limited to 4 primary partitions. This is all that will fit in the first sector (512 bytes) of the disk after the MBR (460 bytes).

In order to have more than 4 partitions, one of them becomes an extended partition, which points to an extended structure further down the disk. This structure lists the logical partitions on the disk.

The "legacy" MBR uses one of the flags on the primary partitions to determine which to boot up; this flag does not exist on logical partitions, so they cannot be booted the same way. Other MBR replacements (e.g. GRUB) do not use this flag and so can boot logical partitions.

Theoretically, any OS can be installed to either primary or logical partitions, but older versions of Windows will not boot properly if not installed to a primary partition.

Solution 2:

Partitions in first place are required for these two reasons-

  • To arrange and maintain the data in an easier way

  • To install one or more OS in your system.

Each partition can have only one OS installed in it. Now coming to the primary partitions part and why they are only 4, we need to look at Master boot record or MBR. MBR has a size of 512 bytes. First 446 bytes consist of Initial program loader(IPL) which are essential for the boot process. Next 64 bytes consist of the partition table. Remaining 2 bytes are the magic bytes which point to the boot files on the hard disk. Each partition that is made is recorded in the partition table. Each partition entry in the partition table needs 16 bytes. Hence 64 bytes table allows us to make only 4 primary partitions.

If we need more than 4 partitions, we move towards extended partitions. Since these partitions are extended form of primary partitions, hence the name.

Only one extended partition can be made. Three other partitions would be primary partitions, because anyhow the partition table would be able to handle only 4 partitions, so there would be 3 primary and one extended. Inside extended partitions we make logical partitions. As such, there is no limit to the number of logical partitions. In some books it is mentioned that logical partitions have a limit of 128, but I've personally made more than that on RHEL 7. There can be many number of logical partitions until the size allocated to extended partition gets exhausted.