How many extended partitions can we have on windows?

9,124

Solution 1

Windows expects at most one (1) extended partition among the four partition entries in the MBR.

Solution 2

You can have four primary partitions, or one extended and three primaries.

The extended can be split into up to more than 60 logical partitions, the amount supported is OS dependent.

Solution 3

There are of red herrings in the answers here so far. The behaviour of Linux — which people didn't even get right — is largely irrelevant to the question as asked, which after its third edit contained two important words even if one ignores the tags:

"on Windows"

Since the question was tagged Windows Vista I'm not going to bother with DOS+Windows.

On Windows NT, of the four entries in the primary MBR, exactly zero or one may be a container partition, and the partition types recognized as container partitions are 0x05 and 0x0F. Not only do Microsoft's disc partitioning utilities enforce this rule, but so too does the operating system kernel. The xHalIoReadPartitionTable() function in the HAL, which is usually what ends up doing the actual work of an IoReadPartitionTableEx() call, has an explicit check for more than one container partition, and will fail, printing a message in the debug kernel, in such a case.

Linux is different. The rules for Windows NT are not the rules across the board. (They aren't the rules for MS-DOS 5, for example. MS-DOS is not as sawdust stated, either. Microsoft doesn't have one set of rules here across all of its operating systems. It changed the rules at least three times as it brought out newer operating systems.) But Linux is a red herring here, with the question as asked. If you want to know about Linux, or what the limitations of the actual on-disc data structures themselves are, don't ask what happens "on Windows".

Share:
9,124
Pacerier
Author by

Pacerier

# 9

Updated on September 18, 2022

Comments

  • Pacerier
    Pacerier over 1 year

    Initially I'd thought that we can only have 1 extended partition, but I'm confused after reading What are the differences between primary and logical partition?

    I understand that we can only have up to 4 primary partitions, but I was wondering how many extended partitions can we have?

    I am aware that we will only need one, but is it true that we can mix and match any number of primary partitions and extended partitions as long as the total count remains within 4?

    For example, could we have 2 primary partitions together with 2 extended ones?

  • Pacerier
    Pacerier over 12 years
    Must the extended partition be at the "rightmost" of the other primary partitions?
  • Pacerier
    Pacerier over 12 years
    superuser.com/questions/337146/… states that we can have more than one extended partitions?
  • Paul
    Paul over 12 years
    Presumably you can mark more than one as an extended partition, but given that the OS is what needs to read the extended partition's logical partition table, it would need to be OS supported. All of this refers to MBR type partitions by the way. There are different limits with different partitioning schemes.
  • sawdust
    sawdust over 12 years
    @Pacerier - No, the extended partition can be any one of the four entries in the partition table of the MBR, and can located anywhere on the disk drive.
  • Pacerier
    Pacerier over 12 years
    What is your comment after reading superuser.com/questions/337146/… which claims that it is possible to have multiple extended partitions ?
  • sawdust
    sawdust over 12 years
    @Pacener - My answer is based on the the rules that Microsoft created, and that MS-DOS implemented. Microsoft OSes will not allow you to create another extended partition it there is already an extended partition in the MBR. If you carefully read JdeBP's comment, he states that the "second extended partition" uses a nonstandard partition type of 0x85 to fool boot loaders and other OSes into treating that partition as "custom". Therefore its logical partitions are inaccessible to all but the OS that created that partition.
  • Pacerier
    Pacerier over 12 years
    which OS can create nonstandard extended partitions?
  • sawdust
    sawdust over 12 years
    @Pacerier - apparently Linux will allow creation of nonstandard partitions when using the command line 'sfdisk' utility. A Linux-based GUI tool such as GParted will not allow you do do anything goofy.
  • JdeBP
    JdeBP over 12 years
    … or you can both go and read what Andries Brouwer actually wrote on this subject around 1997. It's still on xyr WWW site. The Linux kernel does not operate as you state, sawdust. It has zero reliance upon there being but one container. Quite the contrary. It can handle up to all four MBR table entries being container partitions, treats all of the container types the same, and simply assigns slot numbers starting from 5 as it enumerates all contained partitions in all (type 0x05, 0x0F, or 0x85) containers.
  • JdeBP
    JdeBP over 12 years
    … or, rather, there are no such things as "extended partitions" in some other partitioning schemes, which don't need such bodges because they don't have a limited 4-entry primary table to start with.
  • Pacerier
    Pacerier over 12 years
    @JdeBP this is confusing.. do you have a link to the article?
  • sawdust
    sawdust over 12 years
    @JdeBP - umm, I did read it 2 days ago but after I wrote my answer and after Pacerier added the link, so why do you assume I didn't, kiddo? Brouwer's article is the source of my 'sfdisk' comment.
  • JdeBP
    JdeBP over 12 years
    The fact that it's only after I prodded you to read it that you've changed things. You can claim to have read it before that, but all that the rest of us have to go on is what you actually do, which in this case was to ascribe everything to me, not to M. Brouwer.