Windows 10: DISKPART - How to Partition GPT disk

Discus and support DISKPART - How to Partition GPT disk in Windows 10 Tutorials to solve the problem; How to: DISKPART - How to Partition GPT disk [img] Information Some time ago in another thread I promised a fellow Ten Forums member, esteemed geek... Discussion in 'Windows 10 Tutorials' started by Tony K, Oct 24, 2017.

  1. Tony K Win User

    DISKPART - How to Partition GPT disk


    How to: DISKPART - How to Partition GPT disk

    DISKPART - How to Partition GPT disk [​IMG]
    Information Some time ago in another thread I promised a fellow Ten Forums member, esteemed geek and a good friend of mine Tony K to make him a custom DISKPART script when needed:

    Just let me know when you need a DISKPART script, I can make a custom script to you based on how you want to partition the system disk (disk where Windows will be installed). The script I posted is quite basic, to partition a disk where all available space after system partitions will be used for Windows partition. In case you want more data partitions on the same disk, the script needs to be modified. Well, a few days ago Tony sent a PM telling what he wants to do: Dual boot Windows 10 Fall Creators Update and Fast Ring Windows Insider Fast Ring builds, doing this on small 120 GB SSD which is currently partitioned as an MBR disk but should be partitioned as GPT disk in new dual boot setup. He also has an additional 2 TB HDD for data. Instead of simply replying to him, I decided to make a tutorial about this process because this might benefit other fellow members, too.

    This tutorial could have been named as "Dual Boot - The Easy Way" *Wink

    In this tutorial we will use DISKPART to convert an MBR disk to GPT, partition the disk following Microsoft's guidelines, and install two operating systems on it (we'll cover single OS partitioning and setup, too).

    Here's a screenshot of Tony's Disk Management before we start:

    DISKPART - How to Partition GPT disk [​IMG]


    (Click to enlarge.)


    DISKPART - How to Partition GPT disk [​IMG]
    Note Please notice that although the tutorial might look somewhat long and complicated, procedure itself to use DISKPART script to partition HDD and install two operating systems as told in this tutorial is quite easy. If you are not interested in "under the hood" information about DISKPART, how the script works and want to get going faster, grab the script from step 2.3, and jump directly to step 3.1.



    Contents [/i] Use links below to go to any step, back button of your browser to return to this list.


    [table][tr][td]Step One:[/td] [td]Preparations - Create USB install media[/td] [/tr] [tr][td]Step Two:[/td] [td]Preparations - Create DISKPART Script[/td] [/tr] [tr][td]Step Three:[/td] [td]Boot from USB[/td] [/tr] [tr][td]Step Four:[/td] [td]Run DISKPART script[/td] [/tr] [tr][td]Step Five:[/td] [td]Install Primary OS[/td] [/tr] [tr][td]Step Six:[/td] [td]Install Secondary OS[/td] [/tr] [/table]




    Step One [/i] Preparations - Create USB install media 1.1) Download Windows 10 ISO image or create one from Insider or Feature Upgrade UUP files:
    1.2) Create a bootable USB flash drive install media for Windows 10 version and edition you want to install (primary operating system in dual boot) as told in following tutorial: PowerShell Scripting - Create USB Install Media for Windows 10 Installation Upgrade Tutorials



    Step Two [/i] Preparations - Create DISKPART Script 2.1) A DISKPART script is a text file with extension .txt containing all necessary DISKPART commands. It can be made and edited with Notepad

    2.2) Each line is one command with possible parameters. A line starting with REM (remark, not case sensitive) will be ignored, allowing explanations and comments to be added. Even if the script will only be used by yourself, I recommend adding as many REM lines as required to help you to better remember, understand and see what script does also in the future

    2.3) The script I made for Tony is in CODE box below, with REM lines to explain what each command is doing. You can and of course should edit it to meet your needs. We will go through the script command by command but for those anxious to get started, just copy the script, paste it in Notepad and edit.

    Script One: DISKPART script to partition a HDD / SSD for dual boot, or for separate Windows and Data partitions:

    Code:
    Script Two: An alternative DISKPART script to partition a HDD / SSD for single OS assigning all available space to system (Windows) partition:

    Code:
    2.4) First set of DISKPART commands in script selects DISK 0, the primary disk which in most cases is correct (more about this in step 3.4), the disk where Windows will be installed, then wipes it clean and finally converts disk to GPT even if the disk previously already was a GPT disk:

    sel disk 0

    clean

    convert gpt


    DISKPART - How to Partition GPT disk [​IMG]
    Note If you are using DISKPART command line entering commands one by one instead of running script, you need first to start DISKPART with command diskpart, then enter above commands one by one pressing ENTER after each command. Be careful, selected disk will be wiped clean without any warnings (how to check disk ID, see Step 3.4)!

    2.5) The first partition will be a 100 MB EFI system partition formatted in FAT32 file system. We will create, format and label it with following two commands:

    create partition efi size=100

    format quick fs=fat32 label="System"

    2.6) Next, the 16 MB MSR (Microsoft Reserved) partition. This partition will not be formatted, nor will it get a label:

    create partition msr size=16

    2.7) Now the primary OS partition. In this example using Tony's 120 GB SSD, I will make it a 52 GB (53,248 MB) partition. You can of course make the partition exactly as big or small as you wish, minimum size recommended for Windows 10 is 25 GB:

    create partition primary size=53248

    DISKPART - How to Partition GPT disk [​IMG]
    Note If you are partitioning disk only for a single Windows partition using all disk capacity (Script Two in step 2.3), use following commands to create Windows and WinRE partitions and jump then to step 2.11 skipping 2.8 through 2.10:

    Code:
    The above set of DISKPART commands first creates a partition for Windows using all available space, then shrinks it from end of partition with 450 MB and then creates a 450 MB WinRE partition on that space.
    2.8) I will format OS partition as NTFS and label it as W10 FCU, assigning it drive letter W: (I can't use currently reserved drive letters, Windows setup will later automatically change it to CDISKPART - How to Partition GPT disk :):

    format quick fs=ntfs label="W10 FCU"

    assign letter="W"

    You can of course label your Windows partition as you prefer, W10 FCU here is just an example.

    2.9) The recovery partition (WinRE) will be placed between primary OS partition and secondary OS partition. WinRE partition is the only partition that can expand "backwards"; future upgrades requiring more space on WinRE will shrink the C: (primary OS) partition:

    DISKPART - How to Partition GPT disk [​IMG]


    We will create WinRE partition with following commands. Please notice, WinRE partition requires an ID which must be exactly as shown:

    create partition primary size=450

    format quick fs=ntfs label="WinRE"

    set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac"

    2.10) Finally, we'll create partition for secondary OS using all available space left on disk, format and label it but do not assign a drive letter, then exit DISKPART with following commands:

    create partition primary

    format quick fs=ntfs label="W10 IP"

    exit

    2.11) Save the script as Disk0Config.txt on your Windows install USB

    DISKPART - How to Partition GPT disk [​IMG]
    Note A couple of times I've seen a UEFI PC with GPT partitioning to list the boot USB as disk 0, and Windows system disk as disk 1.

    I always prepare myself for this oddity by saving the original script as Disk0Config.txt, then saving another copy of it as Disk1Config.txt with one small but important change: I'll edit disk selection command sel disk 0 as seen in step 2.4, the very first command in script to read sel disk 1, to select disk 1 instead of disk 0.

    This way I am prepared, having a script regardless if the Windows system disk is listed as disk 0 or disk 1.




    Step Three [/i] Boot from USB 3.1) Boot the PC from your Windows 10 install media (USB flash drive)

    3.2) On region and language selection screen, press SHIFT + F10 to open Command Prompt:

    DISKPART - How to Partition GPT disk [​IMG]


    3.3) Type diskpart and press Enter to launch Windows Disk Partition Utility DISKPART, type list disk and press Enter to list available disks, type list vol and press Enter to list available volumes, type exit and press Enter to exit DISKPART (commands highlighted with yellow in screenshot in next step)

    3.4) Note the disk number for Windows system disk shown after command list disk. In most cases it is disk 0, but can occasionally be shown as disk 1 (see note in step 2.7). In this sample case it is as it should be, disk 0. Also note the drive letter for your USB install media shown after command list vol. In this example it is drive E:

    DISKPART - How to Partition GPT disk [​IMG]





    Step Four [/i] Run DISKPART script 4.1) In steps 3.3 & 3.4 I found out that my Windows system disk is disk 0 and USB drive containing Windows setup files and DISKPART scripts is drive E:

    4.2) I can now run DISKPART again, this time telling it with switch /s that I want to run a script Disk0Config.txt (Disk1Config.txt if I had found out that system disk this time had been disk 1):

    diskpart /s E:\Disk0Config.txt

    Script in action (video length 32 seconds):



    4.3) Close Command Prompt




    Step Five [/i] Install Primary OS 5.1) Continue installation normally:

    DISKPART - How to Partition GPT disk [​IMG]


    Clean install tutorial: Clean Install Windows 10 Installation Upgrade Tutorials

    5.2) System disk is partitioned exactly as told in script we run in 4.2. Select the Windows partition (partition for primary OS in dual boot scenario) and click Next, in this example my script labelled it as W10 FCU (Fall Creators Update):

    DISKPART - How to Partition GPT disk [​IMG]


    5.3) Primary OS successfully installed:

    DISKPART - How to Partition GPT disk [​IMG]





    Step Six [/i] Install Secondary OS 6.1) Open Disk Management, right click partition reserved for secondary OS, select Change Drive Letter and Paths and add a drive letter to this partition. Remember, it is currently without drive letter therefore not shown in Explorer because in DISKPART script we didn't assign any letter to it. See tutorial if you need any help in assigning a drive letter: Change and Assign Drive Letter in Windows 10 Hardware Drivers Tutorials

    DISKPART - How to Partition GPT disk [​IMG]


    In this example I assigned letter Z: to this partition

    6.2) Download (or copy from another PC) ISO image for the secondary OS, for instance a Windows Insider ISO or another edition of same version as primary OS. Mount it as virtual DVD by right clicking ISO file and selecting Mount. Note the drive letter ISO got when mounted. In this example mounted ISO is drive G:

    6.3) Open an elevated PowerShell (tutorial)

    6.4) Type following command and press Enter, replacing drive letter for mounted ISO (G: in this example) in /WimFile switch with actual drive letter:

    dism /Get-WimInfo /WimFile:G:\Sources\install.wim

    Note the index number to the edition you want to install as secondary OS. In this example I want to install Enterprise edition, index 3:

    DISKPART - How to Partition GPT disk [​IMG]


    DISKPART - How to Partition GPT disk [​IMG]
    Note Default path to install.wim file is DRIVE:\Sources\install.wim. If you are using an ESD based ISO, or a dual bit architecture ISO, you need to change the path in above command accordingly:
    - In an ESD based ISO the path is DRIVE:\Sources\install.esd
    - In dual bit architecture ISO the path is DRIVE:\x86\Sources\install.wim (or install.esd) for 32 bit W10
    -
    In dual bit architecture ISO the path is DRIVE:\x64\Sources\install.wim (or install.esd) for 64 bit W10

    6.5) Type the following command, replacing drive letter for secondary OS partition (Z:\ in this example) in /ApplyDir switch and mounted ISO drive letter (G: in this example) in /ImageFile switch. Same rules apply as in note in step 6.4 if you are using an ESD based ISO or a dual bit architecture ISO. Be sure to use correct index number:

    dism /Apply-Image /ImageFile:G:\Sources\install.wim /index:3 /ApplyDir:Z:\

    6.6) Press Enter, installation starts:

    DISKPART - How to Partition GPT disk [​IMG]


    Depending on your hardware performance, this takes anything from a minute and a half to 10 minutes. You can freely browse the web or use your PC for anything else while DISM applies Windows image for your secondary OS, Windows is quite good in multitasking

    6.7) When done, the secondary Windows needs to be added to boot menu. Do this with following command (#1 in screenshot in step 6.11), replacing the secondary OS drive letter (Z: in this example) with the actual one:

    bcdboot Z:\Windows

    6.8) Secondary OS was added as default OS to boot menu, the OS which will be booted if user makes no selection within given timeframe (30 seconds by default). We leave it as default OS for now

    6.9) All Windows 10 operating systems are by default listed as Windows 10 on boot menu, regardless of their edition. It is better to change boot entry names to more individual ones, to be sure correct OS will be selected when boot menu is shown. For that we will need command bcdedit. However, as bcdedit switches do not work in PowerShell we need first switch PowerShell to Command Prompt mode.

    This is done with a simple command cmd (#2 in screenshot in 6.11)

    6.10) As the secondary OS is at the moment the default OS, its identifier is {default}. I want to change its description, boot menu entry to W10 Enterprise, doing it with following command (#3 in screenshot in 6.11, description in quotes if it contains spaces):

    bcdedit /set {default} description "W10 Enterprise"

    6.11) Current OS we are booted to at the moment, the primary one has identifier {current}. I want to change it to W10 Pro (#4 in screenshot):

    bcdedit /set {current} description "W10 Pro"

    DISKPART - How to Partition GPT disk [​IMG]


    6.12) Close PowerShell, restart PC

    6.13) We left secondary OS default for now because finalizing Windows setup still needs two restarts. Being default OS it will be automatically booted if user makes no selection within given timeframe, by default 30 seconds:

    DISKPART - How to Partition GPT disk [​IMG]


    You can leave PC to finish setting up secondary OS and restart to it and have a break

    6.14) When on desktop after secondary OS has finished the setup, press WIN + R to open RUN prompt, type msconfig and press Enter to open System Configuration. Select the Boot tab, select your primary OS and click Set as default. Click OK to confirm:

    DISKPART - How to Partition GPT disk [​IMG]


    6.15) Click restart and boot back to primary OS:

    DISKPART - How to Partition GPT disk [​IMG]


    6.16) Both operating systems have now been installed, primary OS set as default:

    DISKPART - How to Partition GPT disk [​IMG]


    That's it geeks!

    Kari

    :)
     
    Tony K, Oct 24, 2017
    #1

  2. Fail loop... Cumulative Update for Windows 10 Version 1607 for x64-based Systems (KB3213986)

    This means you've got a GPT (Guid Partition Table) disk, instead of an MBR (Master Boot Record) disk. In GPT, the System partition automatically acts as the active one, & that is as it should be. Had you typed "List Disk" at the DiskPart prompt, it would
    have shown an asterisks under GPT...

    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt

    ---------- --------- --------- ----- ---- ----

    Disk 0 Online 931 GB 0 B *

    So, that procedure won't be a cure for your condition. Unfortunately, I'm not that much less confused than Aldwinkle on what an actual cure for it will be. I'll look around & post something more if I find it.

    (Looks like Robear has entered a hibernation.)
     
    PCR Just PCR, Oct 24, 2017
    #2
  3. Windows can't be installed because this pc has an unsupported disk layout for UEFI firmware.

    So I am getting the same error as this post. And i followed the steps to create an MSR partition.

    Error when installing Build 10041: “Windows can’t be installed because this PC has an unsupported disk layout for UEFI firmware.”

    I have sucessfully shrank the partition.. now im getting this error.

    "MSR and EFI partitions are only supported on GPT disks. Convert the selected disk to GPT and try again."

    See Command line info below:

    Partition 2 is now the selected partition.

    DISKPART> detail partition

    Partition 2

    Type : 07

    Hidden: No

    Active: No

    Offset in Bytes: 105906176

    Volume ### Ltr Label Fs Type Size Status Info

    ---------- --- ----------- ----- ---------- ------- --------- --------

    * Volume 1 C NTFS Partition 238 GB Healthy Boot

    DISKPART> shrink desired=50 minimum=40

    DiskPart successfully shrunk the volume by: 50 MB

    DISKPART> create partition msr

    MSR and EFI partitions are only supported on GPT disks.

    Convert the selected disk to GPT and try again.

    DISKPART> create partition msr

    MSR and EFI partitions are only supported on GPT disks.

    Convert the selected disk to GPT and try again.
     
    Michelle (Taali), Oct 24, 2017
    #3
  4. Kari Win User

    DISKPART - How to Partition GPT disk

    I think that Step 6, how to deploy secondary OS instead of traditionally installing it at boot might interest you, too. Easier and somewhat faster than "normal" clean install. I call the method "Dual boot - The Easy Way!".
     
  5. Thank @Kari

    An awesome tutorial yet again!
     
    slicendice, Oct 24, 2017
    #5
  6. Tony K Win User
    *Thumbs
     
    Tony K, Oct 24, 2017
    #6
  7. tops Win User
    Awesome...

    Easy to work with 2 OS´s!!

    *Wink
     
  8. Tony K Win User

    DISKPART - How to Partition GPT disk

    Tony K, Apr 4, 2018
    #8
Thema:

DISKPART - How to Partition GPT disk

Loading...
  1. DISKPART - How to Partition GPT disk - Similar Threads - DISKPART Partition GPT

  2. How to check if a Disk uses GPT or MBR Partition in Windows 10

    in Windows 10 News
    How to check if a Disk uses GPT or MBR Partition in Windows 10: Your Windows machine can use GPT (GUID Partition Table) or MBR (Master Boot Record) partition. However, many people don’t know which partition type their computer is using. Therefore, in this article, we are going to show you how to check if a Disk uses GPT or MBR Partition...
  3. GPT needed but disk has OEM partition

    in Windows 10 Installation and Upgrade
    GPT needed but disk has OEM partition: Trying to upgrade Windows 10 Home from 32-bit to 64-bit. After booting from the USB flash drive which, following instructions on the MIcrosoft site had the installation media put on it by the Media Creation tool it asks where do you want to install Windows. This shows...
  4. GPT disks

    in Windows 10 Installation and Upgrade
    GPT disks: Converted 2 drives to GPT (using diskpart utility from the "repair Windows"section of installation dvd) after deleting and removing all partitions and volumes. Windows showed the 4TB drive as being the full size so it had been converted. After windows installed both drives...
  5. PLEASE HELP WITH GPT DISK PARTITION ERROR

    in Windows 10 Installation and Upgrade
    PLEASE HELP WITH GPT DISK PARTITION ERROR: Now I'm at the point of getting frustrated. I did a clean install on my laptop Asus S56CM, at the moment hard drive is wiped clean no OS. I boot from USB disk to install windows and I got to the disk type is of Gpt style for two days now I don't know what to do. My bios...
  6. GPT Reserved Partition showing as Local Disk

    in Windows 10 Drivers and Hardware
    GPT Reserved Partition showing as Local Disk: Hi I have a two laptops with Windows 10 x64. Recently I noticed new partition with next available letter. Size is 128mb and it can't be accessed. I checked in Disk Management but this partition is not listed there as per the below screen: [img] I used MiniTool...
  7. How to sign an existing partition to EFI partition with diskpart

    in Windows 10 Drivers and Hardware
    How to sign an existing partition to EFI partition with diskpart: I was trying to install linux on my UEFI mode windows 10 laptop couple days ago, unfortunately there's something went wrong during the installation process, the grub directly wrote data in my win10 system boot partition. Luckily I saved my data and all the partition still in...
  8. inconsistent partition info in disk manager / diskpart

    in Windows 10 Performance & Maintenance
    inconsistent partition info in disk manager / diskpart: Hello Forum! I hope I can find a guru here, who can explain the "interesting" phenomena of different partition types (in disk manager it's actually listed in the "status" column) being displayed by disk manager vs diskpart. The setup: disk0 has 8 partitions (3 primary,...
  9. the selected disk has an MBR partition needs GPT

    in Windows 10 Installation and Upgrade
    the selected disk has an MBR partition needs GPT: I upgraded my windows 7 pro to Windows 10 pro and decided to do a clean install. The install partition ( boot partition ) is on a HDD with three other partitions. I tried to install from the Windows 10 disk, created from the downloaded ISO image. but greeted with "windows...
  10. Delete Protected Recovery Partition (GPT Disk)

    in Windows 10 Installation and Upgrade
    Delete Protected Recovery Partition (GPT Disk): Last night I wiped out my ASUS T100 tablet to clean install TH2. But there is a 7GB Recovery partition from Windows 8.1 that I can't get rid off using Diskpart. Can someone please assist me? [img] 29808

Users found this page by searching for:

  1. msr and efi partitions are only supported on GPT disks

    ,
  2. msr and efi partitions are only supported on gpt disks.convert the selected disk to gpt and try again.

    ,
  3. efi partitions are only supported on gpt disks

    ,
  4. create partition efi msr and efi partitions are only supported on gpt disks,
  5. diskpart format gpt,
  6. msr and efi are only supported on gpt,
  7. diskpart active gpt,
  8. x86 tablet format gpt ssd,
  9. convert the selected disk to gpt and try again. msr,
  10. msr and efi partions are only supported by gpt disks. convert the selected disk to gpt and try again,
  11. msr and efi patitions are only supported on gpt disks,
  12. MSR and EFI partitions are only supported on GPT disks.,
  13. msr and efi partition are only supported on gpt,
  14. what is gpt partition,
  15. windows 10 uefi active partition diskpart