1

I wanted to display all my partitions, so I entered "fdisk -l". AFAIK, the format of the device file for a scsi hard disk reads like: sd_whichharddisk_whichpartition.

To my surprise, after hitting "fdisk -l", I got:

/dev/sda1 * /dev/sda2 /dev/sda5

So, I got three partitions numbered 1,2 and 5. Why is there a gap between number 2 and 5 ? How many partitions do I have for sure?

1 Answer 1

2

Your drive is formatted using extended and logical partitions. The MBR partition table format allows only 4 primary partitions, so /dev/sda1 - /dev/sda4 are reserved for primary and extended partitions. If you want more than 4 partitions, then you have to use logical partitions within an extended partition.

In your case:

/dev/sda1 is a primary partition
/dev/sda2 is an extended partition

/dev/sda5 is the first logical partition within the /dev/sda2 extended partition.

I'm assuming that /dev/sda5 is being used as your swap partition. Linux recommends that you put your swap space on a separate partition for speed reasons, and many distro installers partition the drive like you are seeing in your system.

This should give you enough flexibility to add additional partitions within the extended partition later if you want and the number of those partitions is not capped at 4. By using extended partitions, you may have up to 15 partitions per drive.

See these links for more details:

http://www.tldp.org/LDP/sag/html/partitions.html
http://www.tldp.org/HOWTO/Partition/fdisk_partitioning.html

2
  • It's not Linux that "allows only 4 primary partitions", it's the MBR partition table format. It's the same on Windows. The GPT format usually used nowadays doesn't have this limitation.
    – Leiaz
    Commented Feb 25, 2015 at 18:19
  • Yes, you are correct. Edited. Commented Feb 25, 2015 at 18:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .