locked
New-Partition always creates the 4th partition as Extended. Is this a bug? RRS feed

  • Question

  • We're setting up our drive using PowerShell.  We need 4 partitions, 3 of which are size controlled, etc.  The 4th just uses the rest of the space on the drive.

    When we switched to creating the 4th partition, when looking in "Disk Manager", we see that it's an "Extended Partition" with a "Logical Drive".  Reading about extended partitions it sounds like they are really no longer used.  Just supported for legacy reasons.

    If we use DISKPART.EXE to create the 4th partition, it's fine.  It creates a Primary Partition.

    Is this a bug in the PowerShell function 'New-Partition', or is something else going on?

    Thanks for the help.

    Jim

    Wednesday, August 16, 2017 7:28 PM

All replies

  • Let me answer this with a question: Does an extended partition have any restriction that limits you in any way?

    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    Wednesday, August 16, 2017 7:59 PM
  • Possibly?  We need a verify specific SSD configuration for the work we are doing.  Every bit on the drive is validated with signatures before we can load anything, etc.  This is enforced starting in the BIOS and continues in a chain of signed things for the rest of the boot.

    I'm not sure it hurts anything, but was curious if this was a bug in PowerShell or if I'm somehow using it wrong.  I don't think I am.  Using DISKPART works as expected and that's easy to automate as well, though not as nice as using the PowerShell cmdlets.

    Jim

    Wednesday, August 16, 2017 8:17 PM
  • Hi,

    Was your issue resolved?

    And if the replies as above are helpful, we would appreciate you to mark them as answers, and if you resolve it using your own solution, please share your experience and solution here. It will be greatly helpful to others who have the same question.

    Appreciate for your feedback.

    Best Regards,
    Albert Ling

    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, August 25, 2017 12:44 PM
  • It wasn't really resolved.  It wasn't clear to me if this is a bug, which I think it is, or if I'm doing something wrong.  I've worked around it using DISKPART.EXE for now, but that's not a good solution as it's much harder to work with than the built-in PowerShell cmdlets.

    Jim

    Monday, September 4, 2017 1:51 AM
  • Hi JamesHelm,

    What is your disk type?

    Based on my research, MBR disk could only have 4 primary partitions, and the 4th partition will become Extended partition automatically.
    GPT disk could have more than 4 primary partitions. The following screenshot, the first one is a MBR disk and the second one is a GPT disk, for your reference:

    For more information, please refer to the following article:
    Understanding Disk Partitions
    https://technet.microsoft.com/en-us/library/dd799232(v=ws.10).aspx

    If you need further help, please feel free to let us know.

    Best Regards,
    Albert Ling


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Wednesday, September 6, 2017 9:12 AM
  • Yes, that is the way the cmdlet behaves.  It will automatically create the 4th partition, of an MBR disk, as Extended.  I'm using MBR ask my disk type.

    If I use DISKPART.EXE however, it will (or can) create the 4th partition as 'Primary', not 'Extended'.  That's what I was asking about.  Why I don't have that option with PowerShell.

    For our Company's image I create the first 3 partitions using PowerShell and the 4th using DISKPART.EXE as we want all the partitions to be 'Primary'.  It's just clunky as DISKPART.EXE isn't a great command-line tool.

    Jim

    Saturday, September 9, 2017 8:54 PM
  • Hi Jim,

    Based on my further research, there might have no built-in parameters in New-Partition to enforce the 4th partition to primary partition.
    In addition, you could try to run gwmi Win32_DiskPartition | Select-Object * to query the disk information.

    Best Regards,
    Albert Ling

    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, September 11, 2017 9:47 AM
  • Hi,

    I am checking how the issue is going, if you still have any questions, please feel free to contact us.

    If you resolved it using our solution, please "mark it as answer" to help other community members find the helpful reply quickly.
    If you resolve it using your own solution, please share your experience and solution here. It will be very beneficial for other community members who have similar questions.
    If no, please reply and tell us the current situation in order to provide further help.

    Appreciate for your feedback.

    Best Regards,
    Albert Ling

    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, September 14, 2017 9:34 AM