• PARTITION MAGIC GUIDE
  • Set Active Partition From Command Prompt

Set Active Partition with Diskpart Command Line

Set active partition from command prompt is often used when you have multiple system in one disk, you can set active partition in Windows 2008, in Windows 2003, and the latest Windows 10, by setting one partition active is to make this partition bootable, at the meantime you set other partition not active

Main interface

Before we go to detailed steps, there are some information we shall know

  • Active partition : active partition must be primary partition
  • Primary partition : OS can only runs in Primary Partitions
  • Boot sector : created by the operating system, located at the beginning of the active partition
  • Boot loader : Find Operating System boot files

Steps to set active partition in command line with diskpart

1. press WIN+R to open RUN box, type diskpart

2. in the opened window type list disk

diskpart_lisk_disk

3. diskpart will list all the disks you have installed, type select disk ###

4. type list partition

5. type select partition ###

6. type active

Now you set this partition active, when you reboot, you can switch to another Windows system.

Set Active Partition in Disk Management

Set active partition in Disk management is another way to make partition bootable, Server 2008, Windows 10, and other Windows Systems can share steps as follow to set active partition:

1. Press shortcut key WIN+R to open RUN box, type diskmgmt.msc , or you can just right-click on Start bottom and select Disk Management in Windows 10 and Windows Server 2008

2. right-click on the partition you want to set active, choose Mark partition as active,

disk_management_mark_active

Set Active Partition in Partition Expert

1. Run Partition Expert, Right-click on one partition to Set Active

mde_set_active_partition

2. Then there is an alert: Setting this partition as active partition will set the other partition as inactive, Are you sure you want to set the partition as active?

partition_expert_info

3. Click YES to continue, > Commit .

DOWNLOAD BUY NOW

Set Active Partition BIOS

1. Reboot your computer, when you say the message Press F# to enter setup , Press the bottom, and you will see BIOS interface.

2. Go into each menu and find terms with BOOT, may be BOOT ORDER, FIRST BOOT DEVICE, things like that, my pc shows Advance BIOS Features: First Boot Device, Second Boot Device, Third Boot Device. > Press Enter

3. Use up and down arrow key to choose between: HDD (hard drive), Floppy, CDROM, or Network; or between: CD-ROM Drive; Removable Devices; Hard Drive; Network boot. BIOS differs.

4. Exit and YES to Save changes

  • Resize a Partition in Windows 7
  • Free Download Partition Magic Portable
  • Move Free Space from One to Another

diskpart set gpt partition active

Top Contributors in Windows 10: Ramesh Srinivasan  -  neilpzz  -  Horace Wiggins  -  franco d'esaro  -  _AW_   ✅

February 14, 2024

Top Contributors in Windows 10:

Ramesh Srinivasan  -  neilpzz  -  Horace Wiggins  -  franco d'esaro  -  _AW_   ✅

  • Search the community and support articles
  • Search Community member

Ask a new question

Activating a GPT Partition

On a Lenovo IdeaPad Ultra Book, I installed a used drive that was working OK and installed Windows 10.  After using it for a short time, I noticed that the C: Drive, Disk 0 , and I copied the files from Drive C from the only partition on the disk to a much larger partition on Logical Disk 1, which is currently Drive D.  In order to complete a move to Drive D, in Diskpart, I typed the command "ACTIVE" without the quotes.  and get a message that this can't be done with a GTP partition.  My question is how to I activate the new partition as the boot drive?

Just for clarity:

moved to files, folders and storage

Report abuse

Replies (1) .

This requires in-depth assistance. Please refer to the Technet Forum from the link below:

https://social.technet.microsoft.com/forums/en-us/home?ppud=4  .

Kind regards.

Was this reply helpful? Yes No

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

Thanks for your feedback.

Question Info

  • Files, folders, & storage
  • Norsk Bokmål
  • Ελληνικά
  • Русский
  • עברית
  • العربية
  • ไทย
  • 한국어
  • 中文(简体)
  • 中文(繁體)
  • 日本語

How to use DiskPart to clean and format drive not working on Windows 10

If a drive is causing problems on Windows 10, it could be a logical issue that can be fixed with a few commands.

DiskPart fix drive on Windows 10

  • Fix MBR drive
  • Fix GPT drive

On Windows 10 , you can use the DiskPart tool to resolve virtually any logical problem with a storage drive, and in this guide, I'll outline the steps that I typically use to fix most issues (such as data corruption or other logical problems) using DiskPart.

DiskPart is a command-line tool to manage drives, partitions, volumes, and virtual disks through Command Prompt. Usually, it works better than other tools like "Disk Management" and the "Format" feature available on File Explorer.

On Windows 10, you can have different partition styles, including Master Boot Record (MBR) and GUID Partition Table (GPT). The MBR is the legacy partition style for the standard Basic Input/Output System (BIOS). The GPT is a newer partition style, usually found in Unified Extensible Firmware Interface (UEFI) computers. The difference between the two is that GPT is meant to replace MBR since it supports more than four partitions, and it's required on drives with more than 2TB of space. You typically want to use GPT, but MBR is also a good option for external storage. These instructions will help you use DiskPart on either partition style.

These steps will erase everything on the selected drive, and you cannot undo the changes. If the drive is still accessible, it's recommended to back up the data before proceeding. If multiple drives are connected to your device, disconnect them to avoid selecting the wrong one.

In this how-to guide , I will walk you through the steps to use DiskPart to clean and format a hard drive to fix data corruption and other problems on Windows 10.

How to fix drive (MBR) problems with DiskPart on Windows 10

To fix drive issues on Windows 10 with DiskPart, use these steps:

  • Open Start .
  • Search for Command Prompt , right-click the top result, and select the Run as administrator option.
  • Type the following command to launch DiskPart and press Enter : diskpart
  • Type the following command to list all the active drives and press Enter : list disk
  • Type the following command to select the drive to clean and press Enter : select disk DISK-NUMBER

In the command, replace "DISK-NUMBER" with the drive number you want to repair as it appears in the "Disk" column. You could erase the wrong drive if you do not perform this step correctly. Proceed with caution.

  • Type the following command to wipe out the drive and press Enter : clean
  • Type the following command to confirm the drive is still selected, and press Enter : list disk
  • Quick note: The output should include an asterisk (*) next to the selected drive. If the correct storage is not specified, perform step 5 again.
  • (Optional) Type the following command to convert the drive to an MBR partition style and press Enter : convert mbr
  • Quick note: This step is only required if the storage is configured as GPT , and you must use MBR partition style. If the partition is already MBR, you don't have to run the command, but running the command won't affect the process. You should be able to determine the partition type with the "list disk" command. If the drive doesn't have a GPT mark (*), it's an MBR partition.
  • Type the following command to create a new partition and press Enter : create partition primary
  • Type the following command to select the new primary partition and press Enter : select partition 1
  • Type the following command to make the partition active and press Enter : active
  • Quick tip: You only have to set a partition as active when using MBR. You can determine if the drive uses an MBR or GPT partition style with the "list disk" command. If the partition has a mark in the GPT column, it's not an MBR partition. If you have to set up a GPT partition style, use the other steps (see below).
  • Type the following command to format the partition using the NTFS file system, set a drive label, and press Enter : format fs=FILE-SYSTEM label=DRIVE-LABEL quick

In the command, replace "FILE-SYSTEM" with the name of the file system to use, such as "NTFS" or "FAT32," and replace "DRIVE-LABEL" with the name of the drive as you want it to appear on File Explorer. The " quick" option isn't required, but it will perform a format faster. However, it's best to skip the option if you are unsure about the drive's condition. The format could take a long time, depending on the hard drive's size. This example formats the drive using the NTFS file system and names the partition "myData": format fs=ntfs label=myData quick

  • Type the following command to assign a letter and make the drive available on File Explorer, and press Enter : assign letter=DRIVE-LETTER

In the command, change "DRIVE-LETTER" for the letter to use on the drive, which is not assigned to another device. This example assigns the "G" letter: assign letter=g

  • Type the following command to terminate DiskPart and press Enter : exit
  • Type the following command to close Command Prompt and press Enter : exit

Once you complete the steps, if the drive does not have physical issues, it should be accessible again through File Explorer.

How to fix drive (GPT) problems with DiskPart on Windows 10

To use DiskPart to fix drive issues with GPT partition style, use these steps:

  • Type the following command to run DiskPart and press Enter : diskpart
  • Type the following command to select the drive you want to clean and press Enter : select disk DISK-NUMBER

In the command, replace "DISK-NUMBER" with the drive number to repair, as it appears in the "Disk" column.

  • Type the following command to confirm the drive is still selected and press Enter : list disk
  • Quick note: The output should include an asterisk (*) next to the selected drive. If the correct storage is not specified, repeat step 5 one more time.
  • Type the following command to convert the partition style to GPT and press Enter : convert gpt
  • Type the following command to format the partition with the NTFS file system, set a drive label, and press Enter : format fs=FILE-SYSTEM label=DRIVE-LABEL quick

In the command, replace "FILE-SYSTEM" with the name of the file system you want to use, such as "NTFS" or "FAT32," and replace "DRIVE-LABEL" with the name of the drive as you want it to appear on File Explorer. The quick option is optional to perform a format faster. However, if you are unsure about the drive's condition, it is best to skip the option. The format could take a long time, depending on the hard drive's size. This example formats the drive using the NTFS file system and names the partition "myData": format fs=ntfs label=myData quick

In the command, change "DRIVE-LETTER" for the letter to use on the drive, which is not assigned to another device. This example sets the "W" letter: assign letter=w

After you complete the steps, the drive should be fixed with a GPT partition style and accessible from File Explorer.

More resources

For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:

  • Windows 11 on Windows Central — All you need to know
  • Windows 10 on Windows Central — All you need to know

Get the Windows Central Newsletter

All the latest news, reviews, and guides for Windows and Xbox diehards.

Mauro Huculak

Mauro Huculak is technical writer for WindowsCentral.com. His primary focus is to write comprehensive how-tos to help users get the most out of Windows 10 and its many related technologies. He has an IT background with professional certifications from Microsoft, Cisco, and CompTIA, and he's a recognized member of the Microsoft MVP community.

  • 2 Sony is working to bring PlayStation VR2 to Windows PC
  • 3 For less than 50 cents per game, you can grab an Xbox Series S and 3 months of Game Pass Ultimate
  • 4 Microsoft is forcefully auto-upgrading 'eligible' users running older versions of Windows 11 to 23H2 ahead of 'Moment 5'
  • 5 The best Wi-Fi 6 mesh router I've ever tested is discounted to an all-time low, and it STILL powers my home network two years later

diskpart set gpt partition active

OnMSFT.com

Diskpart Commands: How to Manage Hard Drive Partitions in Windows 11/10

Pranav Bhardwaj

August 29, 2023

How to Manage Hard Drive Partitions using Diskpart

Looking for more How To posts? Check out our How To Page for all the latest tips on Windows, Microsoft Teams, LinkedIn, and more!

In this article

Efficient hard drive management is essential for maintaining an organized and optimized computer system. Windows operating systems offer various tools to help users manage their data, and Diskpart is one such powerful utility. Diskpart allows users to manipulate hard drive partitions directly from the command line, providing granular control over disk space allocation.

Whether you want to create, extend, delete, or format partitions, Diskpart offers a command-line-driven approach that’s particularly useful for system administrators and advanced users. This guide delves into the details of using Diskpart to manage hard drive partitions effectively in Windows 11/10.

What is Diskpart?

Diskpart, short for “Disk Partition,” is a command-line utility included in Windows 11/10 that empowers users to manage disks, partitions, and volumes. Unlike graphical interfaces, Diskpart operates solely through text-based commands, offering a powerful way to interact with storage devices. It’s especially valuable for managing partitions in scenarios where the graphical interface might not be accessible, such as during system recovery or maintenance.

Diskpart provides a comprehensive set of commands that enable users to create new partitions, extend existing ones, format partitions with different file systems, and even remove partitions entirely. Its versatility and direct control over disk structures make it a preferred tool for those who require a more hands-on approach to disk management.

Precautions to take while using Diskpart commands

While Diskpart can be a highly effective tool, it’s essential to take precautions before using its commands to avoid unintended data loss or system disruptions. 

Here are some precautions to consider:

  • Backup Your Data : Before performing any disk management operations using Diskpart, create backups of your critical data. Diskpart commands can lead to irreversible changes, and having a backup ensures that you can restore your data if something goes wrong.
  • Double-Check Disk Selection : Make sure you’re selecting the correct disk and partition when applying Diskpart commands. A wrong selection can result in unintended changes to your system.
  • Understand Commands : Familiarize yourself with the specific commands you’re going to use and their implications. Misinterpreting commands can lead to data loss or system instability.
  • Use “List” Commands : Utilize commands like list disk, list partition, and list volume to get a clear view of your disk configuration before making any changes. This helps you verify your selections.
  • Avoid Direct “Clean” Command : Be cautious with the clean command, as it removes all partitions from a selected disk without confirmation. This command can lead to complete data loss if not used carefully.

List of common Diskpart commands

Diskpart commands are the building blocks of disk management. Here’s a list of common commands along with their purposes:

How to launch Diskpart on Windows 11/10

Launching Diskpart is a straightforward process. Here’s how you can do it:

  • Press Windows + R to launch the Run Command box. 

Launch Command Prompt with Admin Rights

  • If prompted by User Account Control, click “Yes” to grant administrative privileges to Diskpart. You’ll now be within the Diskpart environment, ready to execute disk management commands.

Diskpart Commands

How to check existing hard drives, volumes, & partitions using DiskPart

Before making any changes, it’s crucial to understand your disk’s current configuration. Diskpart can help you get this information:

  • Open the Command Prompt and enter diskpart.

List Disk Command

  • Type select disk <number> to choose the disk you want to inspect.
  • Similarly, use the list partition and list volume commands to see the partitions and volumes on the selected disk.

List Partition

How to create a partition using Diskpart

Creating a partition using Diskpart provides you with control over its size, file system, and drive letter assignment. 

Creating a partition using Diskpart involves a few steps. Let’s go through the process:

  • Launch Diskpart as described earlier.
  • To access the disk list, use the list disk command, and then choose the desired disk by entering its corresponding number with the select disk # command, where “ # ” is the disk number.

Ensure You Selected The Right Disk

  • After selecting the disk, use the clean all command to wipe out the disk. (optional step)
  • Once the disk is wiped out, use the create partition primary command to create a partition using the entire space on that drive.
  • If you want to create multiple partitions, you can assign how much space a partition could take. For that, use the create partition primary size=X command, where “ X ” is the size that you wish to set to the partition in megabytes.
  • After creating the partition, format it with a file system using the format fs=<filesystem> quick command. For instance, use the format fs=ntfs quick for NTFS or format fs=fat32 quick for FAT32.
  • Once the formatting process is complete, Diskpart will automatically assign a letter to the partition. In the event that it does not, you can manually set it by using the command assign letter=<letter> . Replace “ <letter> ” with the desired drive letter. 

Create Partition Using Diskpart

How to extend a partition using Diskpart

Extending a partition allows you to combine unallocated space with an existing partition. It’s an excellent way to make efficient use of available space.

Here’s how you can do it:

  • Launch Diskpart using the earlier method.
  • Make sure that there is enough free space adjacent to the partition you plan to extend on the same drive without any partitions in between. Verify the contiguous availability of the free space.
  • Use the list disk command to list all the attached disks on your system. Choose the disk containing the partition you want to extend using the select disk <number> .
  • Next, use the list volume command to get the list of all the volumes under the selected disk.
  • Now, choose the volume that you want to extend using the select volume # command. Insert the volume number in place of “ # ”.
  • Next, use the extend command to add the entire free space to the selected volume. However, if you don’t want to include the entire unallocated space to the selected volume, use the extend size=# , and replace “ # ” with the amount of space you want to extend in megabytes.

Extend The Disk Using Diskpart

How to shrink a volume using Diskpart

Shrinking a volume allows you to reclaim unused space, which can then be used to create new partitions or extend existing ones. Here’s how you can shrink a volume using Diskpart:

  • Launch Diskpart using the previously outlined steps.
  • Type list volume to see a list of all volumes on your system. Note the volume number of the one you want to shrink.
  • Enter select volume <number> to choose the volume you wish to shrink.
  • To initiate the shrinking process, type shrink desired=<size> and press Enter. Replace “ <size> ” with the amount of space you want to shrink the volume by in megabytes.
  • Diskpart will calculate the available space that can be shrunk based on the specified size.
  • Once the process is complete, you can exit Diskpart by typing exit and pressing Enter.

Shrink Volume Using The Diskpart

How to delete a partition using Diskpart

You can easily delete a partition, too, using Diskpart. Removing a partition should be done with caution, as it leads to data loss. Follow these steps:

  • Open the Command Prompt and launch Diskpart.
  • Select the disk containing the partition you want to delete using select disk <number> . If you don’t know the disk number, use the list disk command.
  • Now, use the select partition <number> command to select the partition that you want to delete. Use the list partition command if you don’t know the partition number.
  • After selecting the partition, use the delete partition command to delete it.

Delete A Partition Using Diskpart

Similarly, you can use the delete volume command to delete a partition.

How to completely wipe out the hard disk using DiskPart

If you encounter issues when formatting your system’s hard disk, an external hard drive, or a USB pen drive, you can use DiskPart to wipe them clean. However, please note that you cannot clean the disk on which your operating system is installed.

If you need to wipe out an entire hard disk using Diskpart, follow these steps with caution:

  • Type list disk and note the disk number you want to wipe.
  • Select the disk by typing select disk <number> .
  • Now type the clean all command and press Enter. This command will erase all data on the selected disk. Be patient; depending on the size of your hard disk, it could take even hours to complete this command.

Clean Disk Using Diskpart

Alternatives to Diskpart

While Diskpart is a powerful tool for managing hard drive partitions in Windows 11/10, there are alternative methods and third-party tools available for users who prefer different approaches. Here are a couple of alternatives to consider,

Windows Disk Management

Windows Disk Management

Windows provides a built-in graphical tool called “Disk Management.” To access it, right-click on the “Start” button and select “Disk Management.” This tool offers an intuitive interface where you can perform tasks like creating hard drive partitions , formatting, deleting, and resizing them. While it might not offer the same level of command-driven control as Diskpart, it’s user-friendly and suitable for most basic partition management needs.

Third-Party Partitioning Tools

Several third-party partitioning tools are available that provide advanced features and user-friendly interfaces. Tools like EaseUS Partition Master , MiniTool Partition Wizard , and AOMEI Partition Assistant offer capabilities beyond what Diskpart provides, including visual representations of your disk layout, more flexible partition resizing, and better data protection during operations. These tools can be especially useful for users who prefer not to work with command-line utilities.

Can Diskpart commands be undone?

Unfortunately, Diskpart commands are irreversible and can lead to data loss if executed incorrectly. It’s crucial to double-check your commands and backup your data before making any changes using Diskpart.

Can I use Diskpart on external drives and USB devices?

Yes, Diskpart can be used on internal and external drives, including USB devices. However, exercise caution and make sure you select the correct disk to avoid accidental data loss.

Is it possible to resize volumes using Diskpart?

Yes, resizing the volume is possible using the Diskpart shrink and extend commands.

Manage your system hard drive easily

Effective hard drive management is essential for maintaining a well-organized and optimized computer system. Diskpart provides a versatile and powerful solution for managing hard drive partitions in Windows 11/10. By understanding its commands and following the steps outlined in this guide, you can confidently create, extend, delete, and manage partitions according to your needs. Remember to exercise caution, back up your data, and double-check your actions before executing Diskpart commands. With this knowledge, you’ll be well-equipped to make the most of your disk space while ensuring the safety of your data.

Looking for more? Check out these OnMSFT.com posts on Diskpart .

Voice Access comes to Windows 11 OOBE in recent Insider builds

Microsoft president demands ‘human oversight’ on ai to avert ‘weaponization’.

OnMSFT.com is built on:

Wordpress GeneratePress Azure

Theme thanks to heather.

diskpart set gpt partition active

Home About Contact Us

Join our team, © copyright 2014 - 2024 onmsft.com llc.

  • Backup & Recovery
  • Hard Disk Manager
  • HFS+ for Windows
  • ExtFS for Windows
  • Disk Wiper Professional
  • Drive Copy Professional
  • Migrate OS to SSD
  • Paragon Alignment Tool Professional
  • NTFS for Mac
  • Hard Disk Manager for Mac
  • ExtFS for Mac

diskpart set gpt partition active

[How to] Make partition Active or Inactive using DISKPART

The system will boot from the partition only if it has Active flag set.

To make partition Active:

  • Run Command Prompt as Administrator
select disk #
list partition
select partition #

To remove Active flag:

Enter your email and receive updates about special offers and exclusive content!

Connect with us for giveaways, exclusive promotions and last news!

diskpart set gpt partition active

More Recovery Products

  • Partition Manager     Partition Master Personal disk manager   Partition Master Enterprise Business disk optimizer   Edition Comparison Partition Master Versions Comparison   Disk Copy Hard drive cloning utility Partition Master Free Partition Master Pro

Centralized Solutions

MSPs Service

Screen Capture

Video Toolkit

Audio Tools

Transfer Products

File Management

iOS Utilities

More Products

  • Support     Support Center Guides, License, Contact   Download Download installer   Chat Support Chat with a Technician   Pre-Sales Inquiry Chat with a Sales Rep   Premium Service Solve fast and more

EaseUS Partition Master

[How-to] Format Disk from MBR to GPT with DiskPart in Windows 10

More and more users prefer to use the GPT partition style in recent days, so the demand for format disk to GPT partition style is increased. In this article, we will tell you how to format to GPT with DiskPart and an easier tool - EaseUS Partition Master.

 Windows 11/10/8/7  100% Secure

diskpart set gpt partition active

Total downloads

Page content

About the Author

Hot topics in 2023.

diskpart set gpt partition active

With the size of the hard drive getting bigger and bigger, the MBR partition style can't satisfy users' needs anymore because it doesn't support a hard drive larger than 2 TB. As an alternative, the GPT (GUID Partition Table) partition style has become a mainstream choice in recent years. It supports unlimited hard drive storage space and can create a maximum of 128 primary partitions.

There are many MBR users who want to convert their partition style to GPT. Windows' built-in feature - DiskPart, can help users finish the task. Here in this article, we will tell you how to use DiskPart to format to GPT.

Notes and Preparation

1. Back up your disk. Format to GPT partition style might erase your data.

2. With DiskPart, you can only convert basic MBR disks without any partitions or volumes to GPT disks. If there are some partitions or volumes, please back up the data and then delete all partitions or volumes before conversion.

Method 1. Format Disk to GPT with DiskPart Alternative [Easier]

DiskPart helps you convert from MBR to GPT, but the operation is too complicated for many users. Also, entering incorrect command lines could lead to unexpected and serious consequences if you are not familiar with the operation. That's why we want to recommend that users try an easier method, turning to a third-party partition management tool - EaseUS Partition Master Professional - for help.

No matter whether you need to convert from MBR to GPT or from GPT to MBR, this tool enables you to manage it in a simple way with its Disk Converter feature without formatting. Also, it won't cause any data loss issues on your disk.

Here, you can download EaseUS Partition Master and follow the guide to see how to format the disk to GPT in an easier way.

Step 1. Download and launch EaseUS Partition Master on your computer.

Step 2. Go to Disk Converter, select "Convert MBR to GPT" and click "Next" to continue.

convert MBR to GPT - 1

Step 3. Select the target MBR disk that you tend to convert to GPT, and click "Convert" to start the conversion.

convert MBR to GPT - 2

The main purpose of EaseUS Partition Master is to make partition management simpler and easier. Here are some advanced utilities of EaseUS Partition Master that you may also like:

  • Resize Partitions . Adjust the partition size according to your needs.
  • Merge Partitions . Combine two small partitions into a large one.
  • Clone Partitions. You can clone the partitions as well as the operating system.

Note: After you have converted your disk from MBR to GPT with EaseUS Partition Master, you still need to reboot your computer and change the boot mode to UEFI.

Method 2. How to Format to GPT with DiskPart

DiskPart is a Windows built-in utility that uses command lines to perform disk partitioning operations. You don't need to worry if you are a novice user, please follow our guide to entering the command lines one by one, you can successfully format to GPT on your own. Here are the detailed steps.

Step 1. Press the Windows + R keys at the same time. Enter cmd in the Run box and click OK.

Step 2. In the command prompt, type diskpart and press Enter.

Step 3. Type list disk and press Enter. It will show you all the available disks, and assign them with a number like 0, 1, 2... If you only have one disk, then it will be disk 0.

Step 4. Type select disk # (replace # with the number of your disk) and press Enter. DiskPart will tell you that the target disk is selected.

Step 5. Type clean and press Enter. This command line is to remove all the partitions and volumes on the selected disk. It will also erase all the data on it.

Step 6. Type convert gpt and press Enter. Wait until the Command Prompt informs you that DiskPart has converted the selected disk to GPT format successfully.

Convert MBR to GPT with DiskPart

Does this tutorial with pictures help you? If it does, share this step-by-step guide to help more users.

Aside from formatting disks to GPT, Diskpart can also help you create, format, delete, clean, and even erase hard drive partitions. For a step-by-step guide, you can refer to this tutorial for help.

related articles

What is Diskpart? How to Master and Use Diskpart on Windows

Following this guide, you'll further learn what exactly Diskpart does and what Diskpart commands you can apply to manage disk drives, and you can even follow some tips to fix Diskpart errors like a professional. 

Image of Diskpart

Bonus: Change Legacy to UEFI After Converting MBR to GPT

After you have converted your OS disk from MBR to GPT, you need to change the boot mode to UEFI in the BIOS. Here is how you can do it.

Step 1. Shut down your computer and restart it. 

Step 2. Keep pressing the F2 key until the BIOS Setup Utility screen appears.

Step 3. Select Boot under the Boot tab, use the up and down arrows to choose UEFI mode, and press Enter.

Step 4. To save the changes and exit the screen, press F10.

Change boot mode to UEFI

Don't forget to share this article to help more users who need to format their disks to GPT.

The Bottom Line

In conclusion, you can apply Windows built-in DiskPart to format your disk to GPT partition style. Or you can choose a simpler alternative - EaseUS Partition Master to help you finish the task.

No matter which way you choose, remember to change the boot mode to UEFI after converting.

FAQs About Formatting Disk to GPT Using DiskPart

Here in this part, we also collected some hot topics about using DiskPart to format disks to GPT, and if you have the same doubts here, follow and find answers below:

1. How to format GPT?

  • Open Disk Management and right-click on the GPT disk partition.
  • Select 'Format', tick 'Perform a quick format', and click 'OK'.

2. How to Change MBR to GPT using DiskPart?

  • Open DiskPart.
  • Type list disk and hit Enter.
  • Type select disk # and hit Enter. (Replace # with the disk number of MBR disk.)
  • Type clean and hit Enter.
  • Type convert gpt and hit Enter.

3. How to convert disk to GPT?

  • Launch EaseUS Partition Master and go to 'Disk Converter'.
  • Click 'Convert MBR to GPT' and click 'Next'.
  • Select the target MBR disk, and click 'Convert'.

How Can We Help You

diskpart set gpt partition active

Updated by Oliver 

Oliver is an EaseUS professional writer who dares explore new areas. With a passion for solving tech issues with straightforward guides for common users, Oliver keeps honing his writing craft by developing in-depth solutions for disk and partition management, computer boot-up issues, file transfer, etc.

Read full bio

diskpart set gpt partition active

Written by Tracy King 

Tracy became a member of the EaseUS content team in 2013. Being a technical writer for over 10 years, she is enthusiastic about sharing tips to assist readers in resolving complex issues in disk management, file transfer, PC & Mac performance optimization, etc., like an expert.

Product Reviews

 Product Reviews

I love that the changes you make with EaseUS Partition Master Free aren't immediately applied to the disks. It makes it way easier to play out what will happen after you've made all the changes. I also think the overall look and feel of EaseUS Partition Master Free makes whatever you're doing with your computer's partitions easy.

Partition Master Free can Resize, Move, Merge, Migrate, and Copy disks or partitions; convert to local, change label, defragment, check and explore partition; and much more. A premium upgrade adds free tech support and the ability to resize dynamic volumes.

It won't hot image your drives or align them, but since it's coupled with a partition manager, it allows you do perform many tasks at once, instead of just cloning drives. You can move partitions around, resize them, defragment, and more, along with the other tools you'd expect from a cloning tool.

Related Articles

How Do I Format My SD Card on Windows, Mac, or Mobile Phone? [Your Step-by-Step Here]

author icon

How to Fix White Screen of Death on Windows Computer

author icon

How to Create Partitions on USB Drive in Windows 10/11 [Full Guide]

author icon

How to Choose the Right Disk Partitioner for Disk Partitioning [2023 Step-by-Step Guide]

disk 100% usage

Fix 100% disk usage

partition hard drive in Windows 10

Partition Windows 10

Format USB in CMD

Format USB Using CMD

Convert MBR to GPT

Convert MBR to GPT

Combime partitions

Combine/Merge Partitions

Fix Windows can not be installed to this disk

Selected Disk is GPT

C drive is out of space

C Drive Is Full

Transfer Windows 11/10 to new drive

Transfer Windows 11 to New Drive

Get EaseUS Partition Master

Your best companion for disk partitioning, MBR to GPT/GPT to MBR conversion,even OS migration

diskpart set gpt partition active

Copyright ©   EaseUS. All rights reserved.

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Establish and boot to GPT mirrors in 64-bit Windows

  • 3 contributors

This article describes how to successfully set up dynamic boot partition mirroring on GUID Partition Table (GPT) disks.

Applies to:   Windows Server 2012 R2 Original KB number:   814070

Unlike Master Boot Record (MBR) mirrors in 32-bit Windows, there are more steps to successfully create and boot to mirrored boot volumes on GPT disks. This article also describes how to recover after a primary disk failure if the shadow disk did not already have an EFI partition established. The disk must have an EFI partition to boot.

You must have the built-in Diskpart.exe and Bootcfg.exe utilities to create bootable mirror volumes on GPT disks. You can do some of these steps with the Disk Management console, but others you can do only with the built-in Diskpart.exe utility.

For consistency and ease of use, this article uses the Diskpart.exe utility to perform the steps. For help with any Diskpart.exe commands, start Diskmgmt.msc, and then open the help topics on the Help menu.

The steps are performed with real examples. The steps show the expected results returned from each command. Disk 0 is the primary system and boot drive. Disk 1 is the shadow drive.

Prepare the shadow drive for mirroring

Before you set up boot volume mirroring, it is a good idea have another GPT disk in the computer that contains an Extensible Firmware Interface (EFI) partition. The EFI partition contains the system files used to boot the operating system. If the primary system drive (disk-0) fails, you can use the EFI partition on the shadow drive (disk-1) to boot. This step creates and prepares new EFI and Microsoft Reserved (MSR) partitions on the shadow drive. You can use only the Diskpart.exe utility to create the required EFI and MSR partitions. You cannot use the Disk Management console to create or mirror EFI or MSR partitions.

Before you start, make sure that you have another BASIC disk with all unallocated free space of equal or greater capacity than the primary disks system and boot partitions. If you already converted the spare drive to dynamic, revert it back to basic before you follow these steps.

At a command prompt, run the Diskpart.exe utility.

This starts the diskpart console. After it is initialized, DISKPART> is displayed. It waits for your input commands.

Select the disk that you want to be the shadow drive, and then convert the drive to GPT. In this example, disk 1 is used for the mirror (shadow) drive.

  • The disk that you select must not contain any data partitions and must be a raw basic disk with only unallocated space of equal or greater capacity than the primary system disk.
  • The following are the commands that you type at the command prompt.

DISKPART> Select disk 1

Disk 1 is now the selected disk.

DISKPART> Convert GPT

Diskpart successfully converted the selected disk to GPT format.

DISKPART> List partition

Partition ### Type Size Offset Partition 1 Reserved 32 MB 17 KB

If you show more than one partition at this point, you have either selected the wrong drive, or you did not start with a raw drive. Correct this before you continue, or data loss may occur.

Select partition 1 on disk 1, then delete it - you must use the override command to delete the Microsoft Reserved (MSR) partition. You will re-create a new MSR partition after you create the required EFI partition.

DISKPART> Select partition 1

Partition 1 is now the selected partition.

DISKPART> Delete partition override

Diskpart successfully deleted the selected partition.

Select disk-0, and then list the partitions on disk-0. With the output of the list command, create new EFI and MSR partitions on disk 1 that are the same sizes as those on disk 0.

DISKPART> Select disk 0

Disk 0 is now the selected disk.
Partition ### Type Size Offset Partition 1 System 204 MB 32 KB <---- EFI PARTITION Partition 2 Primary 4996 MB 204 MB Partition 3 Reserved 32 MB 9 GB <---- MSR PARTITION

DISKPART> select disk 1

DISKPART> create partition efi size=204

Diskpart succeeded in creating the specified partition.

DISKPART> create partition msr size=32

DISKPART> list partition

Partition ### Type Size Offset Partition 1 System 204 MB 17 KB <---- NEW EFI PARTITION ON SHADOW *Partition 2 Reserved 32 MB 204 MB <---- NEW MSR PARTITION ON SHADOW

Select the EFI partition on the shadow drive, and then assign a letter to the EFI partition so it can be formatted. In this example, the drive letter S is assigned to the shadow EFI partition. You can use any available drive letter for this step.

DISKPART> Assign letter=S

Diskpart successfully assigned the drive letter or mount point.

Open a new command prompt, and then use the format utility to format the EFI partition (S:) with the FAT file system. You must do this so that you can copy the system files from the primary EFI partition to this new EFI partition. Do not format with NTFS. The system cannot boot from an EFI partition unless it is formatted with the FAT file system.

C:\> format s: /fs:fat /q /y

The type of the file system is RAW. The new file system is FAT. QuickFormatting 204M Initializing the File Allocation Table (FAT)... Format complete. 213,680,128 bytes total disk space. 213,680,128 bytes available on disk. 4,096 bytes in each allocation unit. 52,168 allocation units available on disk. 16 bits in each FAT entry. Volume Serial Number is EA34-03C7

Press ALT+TAB to return to the diskpart command window. Select the EFI partition on the primary drive (disk-0), and then assign a drive letter to that EFI partition. In this example, the drive letter P is assigned to the primary EFI partition on disk-0. You can use any available drive letter for this step.

DISKPART> Assign letter=P

Press ALT+TAB again to return to the other command prompt. Use the xcopy command to copy the system files from the primary EFI partition (P:) to the Shadow EFI partition (S:). You must do this to make sure that the shadow drive can boot the system if disk-0 fails. Make sure that you use the correct drive letters if you used different letters for your EFI partitions.

C:\> xcopy p:\*.* s: /s /h

p:\EFI\Microsoft\WINNT50\Boot0003 p:\EFI\Microsoft\WINNT50\ia64ldr.efi p:\EFI\Microsoft\EFIDrivers\fpswa.efi p:\MSUtil\diskpart.efi p:\MSUtil\fdisk.efi p:\MSUtil\format.efi p:\MSUtil\nvrboot.efi 7 File(s) copied

Remove the drive letters assigned to both EFI partitions. This step is optional, because after a reboot they will not be re-assigned.

DISKPART> Select volume P

Volume P is the selected volume.

DISKPART> Remove

Diskpart successfully removed the drive letter or mount point.

Repeat the steps for the S volume.

Convert the primary and shadow drives to Dynamic

Before you can establish a mirror, both the primary (source) drive (Disk-0) and the shadow (destination) drive (Disk-1) must be converted to Dynamic. After the disks are Dynamic (after a reboot), you can then establish the mirror. You can do this step with either the Disk Management console or the Diskpart.exe utility.

With Diskpart.exe, select the disk that you want to convert to dynamic, and then convert it to dynamic. Perform this on both the shadow and primary GPT disks. Start with the shadow disk.

Disk 1 is now the selected disk

DISKPART> Convert dynamic

Diskpart successfully converted the selected disk to Dynamic format.
Disk 0 is now the selected disk
You must reboot your computer to complete this operation.

DISKPART> Exit

Leaving Diskpart...

Shut down and restart your computer to complete the conversion of the system drive (disk-0) to dynamic. This may require two reboots.

Establish a mirror from the boot drive to the shadow drive

After both the primary (disk-0) and shadow (disk-1) drives are dynamic, you can then establish the mirror of the boot volume to the shadow drive. You can do this step with either the Disk management console or the Diskpart.exe utility.

With Diskpart.exe, select the boot volume (C:), and then mirror the volume to the shadow disk (disk-1).

DISKPART> Select volume C

Volume 1 is the selected volume.

DISKPART> add disk=1

Diskpart succeeded in adding a mirror to the volume.

Wait for the volume synchronization to complete, and then quit Diskpart.

Use Bootcfg.exe to add new EFI partition boot entries to NVRAM

Now that you have successfully established the boot mirror, a new boot entry was automatically added to NVRAM so that you can boot to the shadow drive. This new entry is displayed as Boot Mirror C: - secondary plex on the boot menu. If you select it, it will boot into the operating system on the shadow drive. However, if something were to happen to any of the system files or the EFI partition itself on disk-0 or if disk-0 failed completely, you would have to boot from the EFI partition on disk-1. Before this will work, you have to add boot entries into NVRAM with the Bootcfg.exe utility.

At a command prompt, run the Bootcfg.exe utility to display the current boot entries. You have one boot entry for the main operating system (boot entry id:1), and one boot entry for the Mirror (shadow) drive (boot entry id:5).

C:> bootcfg

Boot Options Timeout: 30 Default: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDO CurrentBootEntryID: 5 Boot Entries Boot entry ID: 1 OS Friendly Name: Windows 2003 Server, Enterprise OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS Boot entry ID: 2 OS Friendly Name: LS120 Boot entry ID: 3 OS Friendly Name: CDROM Boot entry ID: 4 OS Friendly Name: EFI Shell Boot entry ID: 5 OS Friendly Name: Boot Mirror C: - secondary plex OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS

Before you can add the new entries for the EFI partition and boot partition on the shadow drive to NVRAM, you have to list the existing partitions on disk-0 so that you can extract partition GUID information about the current EFI partition. Use the bootcfg /list command against disk-0 to display all the partitions:

C:\> bootcfg /list 0

Partition table info for Disk: 0 Partition No: 1 Partition Style: GPT Starting offset: 32,256 Partition length: 213,825,024 Partition GUID: {68d298c0-1b6a-01c1-507b-9e5f8078f531} GUID type: {c12a7328-f81f-11d2-ba4b-00a0c93ec93b} Partition name: EFI system partition Partition No: 2 Partition Style: GPT Starting offset: 213,857,280 Partition length: 5,142,056,960 Partition GUID: {68d298c0-1b6a-01c1-f1b3-12714f758821} GUID type: {af9b60a0-1431-4f62-bc68-3311714a69ad} Partition name: LDM data partition Partition No: 3 Partition Style: GPT Starting offset: 9,153,031,680 Partition length: 1,048,576 Partition GUID: {73e47280-0d38-11d7-b47f-806e6f6e6963} GUID type: {5808c8aa-7e8f-42e0-85d2-e1e90434cfb3} Partition name: LDM metadata partition Partition No: 4 Partition Style: GPT Starting offset: 9,154,080,256 Partition length: 32,505,856 Partition GUID: {1ca4672d-a37c-4e12-bacb-c5ae97924965} GUID type: {e3c9e316-0b5c-4db8-817d-f92df00215ae} Partition name: Microsoft reserved partition

Make a note of the EFI partition GUID. {________-____-____-____-____________} This will be used as the SOURCE GUID in a later command.

In this example, the value is {68d298c0-1b6a-01c1-507b-9e5f8078f531} and will be used in a later command.

Use the bootcfg /list command against disk-1 to display all of its partitions:

C:\> bootcfg /list 1

Partition table info for Disk: 1 Partition No: 1 Partition Style: GPT Starting offset: 17,408 Partition length: 213,909,504 Partition GUID: {476688c5-8ebf-47d2-80e7-cf9d065edb81} GUID type: {c12a7328-f81f-11d2-ba4b-00a0c93ec93b} Partition name: EFI system partition Partition No: 2 Partition Style: GPT Starting offset: 213,926,912 Partition length: 1,048,576 Partition GUID: {b72d10f6-e94e-4a4d-bb8e-4da985cc1679} GUID type: {5808c8aa-7e8f-42e0-85d2-e1e90434cfb3} Partition name: LDM metadata partition Partition No: 3 Partition Style: GPT Starting offset: 214,975,488 Partition length: 32,505,856 Partition GUID: {824858f3-b8d5-4b4d-a3c7-18aac4442b7e} GUID type: {e3c9e316-0b5c-4db8-817d-f92df00215ae} Partition name: Microsoft reserved partition Partition No: 4 Partition Style: GPT Starting offset: 247,481,344 Partition length: 5,142,056,960 Partition GUID: {f3d11286-2582-4d76-889c-b82c346be44e} GUID type: {af9b60a0-1431-4f62-bc68-3311714a69ad} Partition name: LDM data partition

Make a note of the EFI partition GUID. {________-____-____-____-____________} This will be used as the TARGET GUID in a later command.

In this example, the value is {476688c5-8ebf-47d2-80e7-cf9d065edb81} and will be used in a later command.

Now you have the SOURCE and TARGET EFI GUID values that you have to clone the boot entries in NVRAM. The new entries use the new EFI partition GUID on the shadow drive to boot the system if disk-0 fails in any way. Use the bootcfg /clone command to add new NVRAM boot entries with your source and target GUID values recorded in steps 2 and 3.

C:>bootcfg /clone /sg {68d298c0-1b6a-01c1-507b-9e5f8078f531} /tg {476688c5-8ebf-47d2-80e7-cf9d06 5edb81} /d+ Cloned_Entry

INFO: Boot entry whose id is '1' successfully cloned. INFO: Boot entry whose id is '5' successfully cloned. SUCCESS: The operation completed successfully.

To see the new Cloned entries added to NVRAM, use the bootcfg command and notice you now have seven entries instead of five. The bottom two entries are the cloned entries and will use the EFI partition on the shadow drive (disk-1) to boot.

C:\>bootcfg

Boot Options Timeout: 30 Default: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS CurrentBootEntryID: 5 Boot Entries Boot entry ID: 1 OS Friendly Name: Windows 2003 Server, Enterprise OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS Boot entry ID: 2 OS Friendly Name: LS120 Boot entry ID: 3 OS Friendly Name: CDROM Boot entry ID: 4 OS Friendly Name: EFI Shell Boot entry ID: 5 OS Friendly Name: Boot Mirror C: - secondary plex OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS Boot entry ID: 6 OS Friendly Name: Windows 2003 Server, Enterprise Cloned_Entry OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume3\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS Boot entry ID: 7 OS Friendly Name: Boot Mirror C: - secondary plex Cloned_Entry OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume3\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS

Test-boot the shadow drive with the new boot entries

After you have created the new boot entries in NVRAM, test the entries to make sure that the system can boot to the shadow drive if disk-0 fails.

  • Perform a graceful shutdown and restart of Windows.
  • On the boot menu, select the boot entry named Boot Mirror C: - secondary plex Cloned_Entry to boot to the shadow drive. The EFI partition on the shadow drive will be used to boot the Windows operating system. Although you do not have to, you can also turn off the computer, remove disk-0, and then redo the test to make sure that the system will be bootable if the original system disk really fails and is removed.

Recover a shadow boot drive with missing or damaged EFI partition

If the original Windows operating system was software mirrored to a Dynamic GPT disk that did not contain an EFI partition, or the EFI partition becomes damaged, or if the primary system disk (disk-0) fails, you may receive the following error message when you try to boot to the shadow disk:

LOADING.: Boot Mirror C: - Secondary plex Load of Boot Mirror c: - secondary plex failed: Not Found Paused - press any key to continue.

You must now use the following procedure to recover the original operating system (shadow) drive. These following steps show you the whole process. The process includes replacing the failed disk-0, re-installing Windows on the new replacement disk, which creates a new EFI system partition, and then adding new boot entries into NVRAM so that you can boot back into the original operating system on the shadow disk-1.

Remove the failed system drive (disk-0) and replace it with a good disk. See your hardware manuals for the correct way to replace the failed disk. The replacement disk does not have to be partitioned or formatted. It can be a brand new disk.

Insert the Windows 2003 Server installation CD into the computer's CD-ROM drive, then power on the system.

When the system boot options menu is displayed, select to boot from CD-ROM. When you are prompted to press any key to boot from the CD, press any key.

This starts Windows 2003 Server setup.

On the Welcome to Windows Setup screen, press ENTER to install and allow Setup to automatically create the new system partition.

You must do this to boot and allow Setup to continue.

After the new EFI and MSR partitions are created, select the free space on disk-0 and create a new partition large enough to install Windows and hold a page file.

Select the newly created partition to install Windows on, and then select the format option that you want to format the partition. Setup continues. Answer all appropriate questions that you are prompted with, and then let Setup finish.

After Setup is complete, log on the console as Administrator.

At a command prompt, run the bootcfg command to display the current boot menu items from NVRAM.

Boot Options Timeout: 5 Default: \Device\HarddiskVolume3\WINDOWS CurrentBootEntryID: 1 Boot Entries Boot entry ID: 1 OS Friendly Name: Microsoft Windows Server 2003, Enterprise Edition OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskVolume3\WINDOWS Boot entry ID: 2 OS Friendly Name: Windows Server 2003, Enterprise Edition OsLoadOptions: N/A BootFilePath: (null) OsFilePath: (null) Boot entry ID: 3 OS Friendly Name: LS120 Boot entry ID: 4 OS Friendly Name: CDROM Boot entry ID: 5 OS Friendly Name: EFI Shell Boot entry ID: 6 OS Friendly Name: Boot Mirror C: - secondary plex OsLoadOptions: N/A BootFilePath: (null) OsFilePath: (null)

Use the bootcfg /list command to display all of the partitions on the shadow disk (disk-1). Locate the original Windows boot partition. It has the name of LDM data partition and has a partition length the same size as the original boot partition.

In this example, the boot partition is entry No: 3 with the GUID of {9aee294a-fa7d-4d4a-8a47-51a1dd1f9867}

C:\bootcfg /list 1

Partition table info for Disk: 1 Partition No: 1 Partition Style: GPT Starting offset: 17,408 Partition length: 1,048,576 Partition GUID: {646091f1-b826-47e8-a72c-f22072e9a769} GUID type: {5808c8aa-7e8f-42e0-85d2-e1e90434cfb3} Partition name: LDM metadata partition Partition No: 2 Partition Style: GPT Starting offset: 1,065,984 Partition length: 32,505,856 Partition GUID: {afb1e6b9-d8a6-456d-8df1-31327f94f3fe} GUID type: {e3c9e316-0b5c-4db8-817d-f92df00215ae} Partition name: Microsoft reserved partition Partition No: 3 Partition Style: GPT Starting offset: 33,571,840 Partition length: 3,142,056,960 Partition GUID: {9aee294a-fa7d-4d4a-8a47-51a1dd1f9867} GUID type: {af9b60a0-1431-4f62-bc68-3311714a69ad} Partition name: LDM data partition Partition No: 4 Partition Style: GPT Starting offset: 3,175,628,800 Partition length: 1,174,758,912 Partition GUID: {ab104fde-0782-4810-842e-0fb291e385ad} GUID type: {af9b60a0-1431-4f62-bc68-3311714a69ad} Partition name: LDM data partition

Use the bootcfg /mirror command to add a boot entry into NVRAM for the shadow disks boot partition and give it a meaningful description. Use the Partition GUID from the boot partition extracted earlier.

C:\>bootcfg /mirror /add {9aee294a-fa7d-4d4a-8a47-51a1dd1f9867} /D "Original Shadow drive"

SUCCESS: The mirrored boot entry has been added.

Use bootcfg to display the boot menu items again. Notice the new entry was added to the bottom of the list. You can now use this entry to boot to the original Windows operating system.

- C:\>bootcfg

Boot Options Timeout: 5 Default: \Device\HarddiskVolume3\WINDOWS CurrentBootEntryID: 1 Boot Entries Boot entry ID: 1 OS Friendly Name: Microsoft Windows Server 2003, Enterprise Edition OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskVolume3\WINDOWS Boot entry ID: 2 OS Friendly Name: Windows Server 2003, Enterprise Edition OsLoadOptions: N/A BootFilePath: (null) OsFilePath: (null) Boot entry ID: 3 OS Friendly Name: LS120 Boot entry ID: 4 OS Friendly Name: CDROM Boot entry ID: 5 OS Friendly Name: EFI Shell Boot entry ID: 6 OS Friendly Name: Boot Mirror C: - secondary plex OsLoadOptions: N/A BootFilePath: (null) OsFilePath: (null) Boot entry ID: 7 OS Friendly Name: Original Shadow drive OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: (null)

Shut down the computer, and then restart it. Select the boot menu item Original Shadow Drive to boot into the original operating system. This brings the server back into production. To fix the mirroring so that you can use the new disk-0 as your primary operating system drive and again be in a fault tolerant environment, continue with the following steps.

Re-establish the primary boot drive mirror

While booted into the shadow drive (disk-1), you must "remove" the broken mirror, and then delete the missing disk. You can do this with either the Disk Management console or the Diskpart.exe utility.

If there were additional volumes on the original failed dynamic disk-0, they must also be deleted before you are permitted to delete the missing disk.

With Diskpart.exe, list the volumes, and then make a note of the volume number (Volume #) of the failed mirror. Select the mirror volume (volume #), and then view the details to see what missing disk (m#) you need to break the mirror from. In this example, you are working with volume 0 on missing disk m0.

DISKPART> list volume

Volume ### Ltr Label Fs Type Size Status Info Volume 0 C PRIMARY NTFS Mirror 2996 MB Failed Rd Boot Volume 1 D CD-ROM 0 B Healthy Volume 2 Partition 2996 MB Healthy Volume 3 Partition 102 MB Healthy System

DISKPART> select volume 0

Volume 0 is the selected volume.

DISKPART> detail volume

Disk ### Status Size Free Dyn Gpt Disk M0 Missing 2996 MB 0 B * Disk 1 Online 4149 MB 1120 MB **

Break the mirror by specifying the missing disk (m0), and then use the no keep option to remove the plex (partition) from the missing disk. List the volumes to make sure the mirror is gone and the volume is now listed as a simple volume.

DISKPART> break disk=m0 nokeep

The service did not update the boot file. Diskpart successfully broke the mirror volume.
Volume ### Ltr Label Fs Type Size Status Info Volume 0 C PRIMARY NTFS Simple 2996 MB Healthy Boot Volume 1 D CD-ROM 0 B Healthy Volume 2 Partition 2996 MB Healthy Volume 3 Partition 102 MB Healthy System

Select the missing disk (m0), and then delete it.

DISKPART> select disk m0

Disk M0 is now the selected disk.

DISKPART> delete disk

Diskpart successfully deleted the missing disk.

Delete the new Windows Server operating system partition on disk-0, because it is no longer required. This makes room to re-mirror back to disk-0.

This step is optional if you have sufficient free space on disk-0 to re-establish the mirror.

DISKPART> select disk 0

Partition ### Type Size Offset Partition 1 System 102 MB 32 KB Partition 2 Reserved 31 MB 102 MB Partition 3 Primary 2996 MB 133 MB

DISKPART> select partition 3

Partition 3 is now the selected partition.

DISKPART> delete partition

Convert disk-0 to Dynamic, and then select the operating system volume on disk-1 and re-establish the mirror back to disk-0. This puts the computer back into a fault tolerant environment, and after the mirror is healthy you can boot back into disk-0 with the new boot option that was automatically added to the NVRAM.

DISKPART> convert dynamic

Diskpart successfully converted the selected disk to dynamic format.

Volume ### Ltr Label Fs Type Size Status Info Volume 0 C PRIMARY NTFS Simple 2996 MB Healthy Boot Volume 1 D CD-ROM 0 B Healthy Volume 3 Partition 102 MB Healthy System

DISKPART> add disk=0

Wait for the mirror status to become healthy. You can use the list volume command repeatedly until the status changes from Rebuild to Healthy. Quit the Diskpart utility.

Volume ### Ltr Label Fs Type Size Status Info Volume 0 C PRIMARY NTFS Mirror 2996 MB Healthy Boot

DISKPART> exit

Use the bootcfg command to view the new boot option that was added to the NVRAM. This new entry is named Boot Mirror C: - secondary plex and is most likely menu item ID 1. You can now clean up the original boot entries for the original operating system and the original secondary plex with the bootcfg /delete /ID # command.

Boot Options Timeout: 30 Default: (null) CurrentBootEntryID: 7 Boot Entries Boot entry ID: 1 OS Friendly Name: Boot Mirror C: - secondary plex OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: (null) Boot entry ID: 2 OS Friendly Name: Windows Server 2003, Enterprise OsLoadOptions: N/A BootFilePath: (null) OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS Boot entry ID: 3 OS Friendly Name: LS120 Boot entry ID: 4 OS Friendly Name: CDROM Boot entry ID: 5 OS Friendly Name: EFI Shell Boot entry ID: 6 OS Friendly Name: Boot Mirror C: - Secondary Plex OsLoadOptions: N/A BootFilePath: (null) OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS Boot entry ID: 7 OS Friendly Name: original shadow system OsLoadOptions: N/A BootFilePath: \Device\HarddiskVolume1\EFI\Microsoft\WINNT50\ia64ldr.efi OsFilePath: \Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1\WINDOWS

C:\>bootcfg /delete /ID 6

SUCCESS: Specified boot entry has been deleted.

C:\>bootcfg /delete /ID 2

This concludes this procedure and the remaining boot entries in the boot menu are all valid boot entries to boot to both the primary and shadow drives.

GPT mirroring in Windows Server 2008

If you are using Windows Server 2008, visit the following article to set up a GPT mirror:

How to set up dynamic boot partition mirroring on GUID partition table (GPT) disks in Windows Server 2008

Was this page helpful?

Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback .

Submit and view feedback for

Additional resources

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Finding which partition on a particular disk is active from the command line

For example, if I'm booted from Windows PE, or remoting into a system using psexec or another command-line based method. I know that diskpart.exe allows you to set the active partition, but I can't find any way of seeing which partition is currently active.

Hopefully there's a simple answer and I'm just missing it ...

  • command-line
  • partitioning

slhck's user avatar

4 Answers 4

Only way I know how to do this is close to what @Maximus put but do the following:

The output will indicate

enter image description here

You have to go through each volume to find which ones are Active and which ones are not. You can use Diskpart's list volume command to show all volumes and find the one you want to check first.

I say Reinstate Monica's user avatar

  • 1 Note this only works for MBR disks, but fails for GPT disks as there the concept of "active" is not part of the partition but of the BCD . –  Jeroen Wiert Pluimers Dec 29, 2022 at 12:50

You can use wmic to do this. You may wish to export it to a text file ( >output.txt ) and view without word wrapping since the tabular output can get very wide.

To list all partitions (look at the BootPartition member to check if it's marked as active ):

To list just active partitions, filter with where :

To filter which columns are displayed, use get :

For more information on partition members, see the Win32_DiskPartition documentation .

BootPartition Data type: boolean Access type: Read-only Partition is the active partition. The operating system uses the active partition when booting from a hard disk.

Take a look at the WQL syntax for more information on the usage of where . Take a look at wmic partition get /? for more information on get .

With wmic you have added advantages with remote management using the /node:<servername or ip> switch (see wmic /node /? for more information. As per Microsoft :

WMIC can be used from any computer with WMIC enabled to remotely manage any computer with WMI. WMIC does not have to be available on the remotely managed computer in order for WMIC to manage it.

If you can figure out some way of programmatically (e.g. batch script) getting the drive letter from the disk and partition index, you may wish to use a for loop with the members DiskIndex and Index (disk and partition indexes, respectively).

Bob's user avatar

Look into last column (System)?

Maximus's user avatar

  • What if it is not a system disk; how can you tell if the partition is active? For example, if you have a second disk with a FAT32 partition from which XP is dual-booted, does it say System ? –  Synetech Jul 16, 2012 at 20:55
  • I thought at first this was the correct answer, but it turns out that this only shows which partition the running instance of Windows was booted from. If the active partition has changed since then, or if you are booted from removable media, it doesn't work. –  Harry Johnston Jul 16, 2012 at 21:03
  • But how about asterisk in detail disk (first column)? May be it is the answer? –  Maximus Jul 16, 2012 at 21:10
  • No, the asterisk shows you which volume (if any) is currently selected (SELECT VOLUME or SELECT PARTITION). –  Harry Johnston Jul 16, 2012 at 23:20

As a fans of Cygwin , I'll suggest use the fdisk utility from the util-linux package to do this if you're not using GPT .

If you're remoting into a system, you need to install Cygwin on that system.

If you're booting from Windows PE, you can manually download the packages and extract them using a proper decompressor which can handle .tar.bz2 files.

Packages needed to download to run fdisk

  • util-linux/libblkid1
  • util-linux/libuuid1
  • libiconv/libiconv2
  • gettext/libintl8
  • gcc4/libgcc1

Example (1 hdd, 1 flash drive)

LiuYan 刘研's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged windows command-line partitioning ..

  • The Overflow Blog
  • Who owns this tool? You need a software component catalog
  • Featured on Meta
  • Upcoming privacy updates: removal of the Activity data section and Google...
  • Changing how community leadership works on Stack Exchange: a proposal and...

Hot Network Questions

  • Ring Learning With Errors : why is it called ring and referred it as Ring LWE
  • What are the differences between a synagogue and a temple?
  • How does one perform induction on integers in both directions?
  • How can I properly make a bash prompt with error colors and emoji?
  • Do American supermarkets have shopping cart conveyors or shopping cart coins?
  • Logical Meaning of Apostrophe in Formal Notation?
  • I have found so many tools that can solve optimization problems, I want to know which workflow is the best or the most practical?
  • Why did it take so long for the U.S. government to give Medicare the power to negotiate prescription drug prices directly with drug companies?
  • The Devil's Shell Game
  • What investments for US expats don't trigger taxes on unrealized gains
  • awk (and gawk) : how to avoid fatal error when 1 of the N input files is unreadable
  • Would it be legal for a US state or the federal government to ban all homeopathic "medications"?
  • Snowflake won't allow an analytic function to be renamed
  • 10-year UK visa ban. 15 years later and new citizenship
  • Calculate Riemann integral
  • What happens when the runway is unusable at an isolated aerodrome?
  • Can I raise my ceiling in my shed?
  • Gradient along the surface of a helical spiral
  • Sherlock's AZED crossword
  • Word request: Sensory words
  • List of built-in functions written in Wolfram Language
  • An Amazing Configuration
  • Is Freyd's thesis available online anywhere?
  • A canal between two rivers

diskpart set gpt partition active

The Best Windows Disk Partition Manager and PC Optimizer

diskpart set gpt partition active

  • DiskPart Command Line Utility >

Using Diskpart to Initialize Disk into MBR/GPT Format

To use a brand new hard disk, you need to initialize it first. Diskpart can initialize disk to MBR or GPT via command line in Windows 11/10/8/7.

Cherry

By Cherry / Updated on May 12, 2023

twitter

  • Method 1. Use Diskpart to initialize disk
  • Method 2. Initialize a disk with AOMEI Partition Assistant (GUI)
  • Method 3. Initialize disk with AOMEI Partition Assistant command-line

Why do you want to initialize disk?

When you use a new disk, you'll receive a message that says "You must initialize a disk before Logical Disk Manager can access it," prompting you to do so. Alternatively, you might prepare a disk for reuse. So, how does one go about initializing a disk? Here are three methods to go about it.

3 methods to initialize disk in Windows

Method 1. use diskpart to initialize disk.

Diskpart is one of Windows' basic utilities with command lines. You can use it to manage your disk/partition/volume with a special command line, such as create/delete/format/extend/shrink partitions and initialize/convert disk, etc. It is more powerful than Windows Disk Management.

To use a new disk or wipe an existing disk, initializing the disk with Diskpart can work it out. 

Step 1. You can press "WIN+R" and type "cmd" to open the prompt. Then, type diskpart in the prompt and press "Enter".

Step 2.  Type the following commands and press "Enter" after each.

• list disk  • select disk x • attributes cleared successfully  (it can move to the next step smoothly) • online disk • convert mbr  or convert gpt  (to change the selected disk to MBR format or GPT format according to your requirements).

Initialize

Once you initialized the disk and convert the disk into MBR format or GPT format, you can create a partition on it, which is pragmatic. You can use Diskpart to create a partition for you.

Method 2. Initialize a disk with AOMEI Partition Assistant (GUI)

The Diskpart does have a good way to help you initialize a disk. But there still are many other ways to initialize a disk. For example, initializing a hard disk using AOMEI Partition Assistant could be simpler. AOMEI Partition Assistant Professional  is a great alternative if you don't like to use commands or Diskpart can't initialize the target successfully.

 It contains a cmd utility called Partassist.exe, which can replace the Diskpart of Windows, and it also provides you GUI for initializing a disk. And also provides a way to initialize the disk with its concise interface. With the GUI (graphical user interface), you can use a few mouse clicks to replace initializing disk via the Diskpart command.

Step 1.  Install and launch AOMEI Partition Assistant. Select the disk you want to initialize, right-click it. Then, select "Initialize Disk" in the pop-out menu.

Initialize Disk

Step 2. Select to initialize the disk to MBR/GPT. Click "OK".

Select Disk Style

Step 3.  Click " Apply" at  the toolbar to confirm the operations.

Apply Proceed

The AOMEI Partition Assistant initializing disk with an intuitive interface is much simpler than using Windows Diskpart to initialize disk. Besides, you can use it to do more for partitioning a hard drive . And it supports most Windows systems, as for the Windows Server system, you can use the Server Edition .

Method 3. Initialize disk with AOMEI Partition Assistant command-line

If you cannot use the CMD in the right way, you can also use the interface of AOMEI Partition Assistant to skip step-by-step operations. Partassit.exe utility can do much more for users than Diskpart. To use the partassist.exe command-line utility, click the "Start" menu, type "cmd" in the search box, or press "WIN + R" keys and type "cmd" to open a prompt, then run it as an administrator.

After that, Command Prompt will open. In the command window, please type the following lines and press "Enter" after each. Here we take an example of how to initialize a disk as GPT.

• cd installation directory of AOMEI Partition Assistant (e.g. cd C:\Program Files \AOMEI Partition Assistant). • partassist.exe /list  ( To list all disks on your computer.) • partassist.exe / init:1 /gpt   (To convert Disk 1 into GPT disk style.)

Open AOMEI CMD

Wait till the progress reaches 100%. It will tell you "The operation completed successfully".

Initialize Disk Successfully

If you wish to avoid using orders in diskpart to initialize disk, you can try AOMEI Partition Assistant to do this work. And if you have some initialized disk wish to change the partition style, you can also convert to GPT/MBR with this powerful tool without losing any data, no matter the target disk is a system disk or data disk.

Cherry

Related Articles

How to fix disk 1 unknown not initialized in windows 11/10/8/7.

Have you ever met the problem that “Disk 1 unknown not initialized” in Windows 11/10/8/7? Today we will explain the possible causes and effective methods to help solve the Disk unknown and not initialized issue.

Solved: Unable to Initialize a Hard Drive in Windows 11, 10, 8, 7

Hard drive won't initialize? Unable to initialize hard drive via Windows 11, 10, 8, 7 Disk Management? Here are some effective ways you can try to initialize hard drive successfully.

Should You Initialize Your Disk to MBR or GPT and Why?

What type should you initialize your disk? MBR or GPT? This article will tell you why and the difference between them. And how can you convert between MBR and GPT with AOMEI Partition Assistant.

Free Download to Try AOMEI Partition Assistant Now

diskpart set gpt partition active

IMAGES

  1. How to Set Active Partition in Diskpart Command Line

    diskpart set gpt partition active

  2. diskpart set boot partition windows 10 Archives

    diskpart set gpt partition active

  3. How to Set an Active Partition on Windows in 3 Ways

    diskpart set gpt partition active

  4. DISKPART

    diskpart set gpt partition active

  5. Diskpart gpt active

    diskpart set gpt partition active

  6. DISKPART

    diskpart set gpt partition active

VIDEO

  1. Convert GPT To MBR| The selected Disk Is Of GPT Partition Style

  2. Convert GPT to MBR via CMD #shorts #partition #storage #laptop

  3. Solusi Harddisk GPT PROTECTIVE PARTITION

  4. What is a GPT partition?

  5. Converting an MBR Partition to A GPT Partition.avi

  6. how to partition hard disks in windows 11

COMMENTS

  1. How is the "active partition" determined when using GPT?

    How is the "active partition" determined when using GPT? Ask Question Asked 11 months ago Modified 11 months ago Viewed 3k times 2 According to https://superuser.com/a/1081043/380318 there is no such concept as an "active partition" when using GPT.

  2. DISKPART

    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.

  3. How to change active partition in GPT Hard Disk

    Hi There, We have one Hard Disk which is UEFI enabled and for this reason we have already converted the Hard disk to GPT. Currently we are booting the machine from C: drive, so in this case boot drive is C:. Now we want to boot the computer with USB drive which is having WinPE OS. In GPT hard disk "Active" command won't work, so in this case ...

  4. How to Set Active Partition in Diskpart Command Line

    Steps to set active partition in command line with diskpart 1. press WIN+R to open RUN box, type diskpart 2. in the opened window type list disk 3. diskpart will list all the disks you have installed, type select disk ### 4. type list partition 5. type select partition ### 6. type active

  5. UEFI/GPT-based hard drive partitions

    To set partitions as utility partitions. When you're deploying Windows by using DiskPart, use the attributes volume set GPT_ATTRIBUTE_PLATFORM_REQUIRED command after you create the partition to identify the partition as a utility partition. For more information, see the MSDN topic: PARTITION_INFORMATION_GPT structure. To verify that system and ...

  6. diskpart

    Shifts the focus to a disk, partition, volume, or virtual hard disk (VHD). set id: Changes the partition type field for the partition with focus. shrink: Reduces the size of the selected volume by the amount you specify. uniqueid: Displays or sets the GUID partition table (GPT) identifier or master boot record (MBR) signature for the disk with ...

  7. Change a Master Boot Record (MBR) into a GUID partition table (GPT

    Back up or move the data on the MBR disk prior to conversion. Open an elevated command prompt: select and hold (or right-click) Command Prompt, and select Run as Administrator. At the prompt, enter diskpart to initiate the disk partition process. Prepare the MBR disk for conversion by cleaning (deleting) any partitions or volumes.

  8. Activating a GPT Partition

    Created on April 10, 2017 Activating a GPT Partition On a Lenovo IdeaPad Ultra Book, I installed a used drive that was working OK and installed Windows 10.

  9. How to use DiskPart to clean and format drive not working on Windows 10

    Type the following command to launch DiskPart and press Enter: diskpart Type the following command to list all the active drives and press Enter: list disk Type the following command to...

  10. Diskpart Commands: How to Manage Hard Drive Partitions in Windows 11/10

    Press Windows + R to launch the Run Command box. Type " cmd " and press Shift+Enter to open the Command Prompt with admin rights. In the Command Prompt, type diskpart and press Enter. This ...

  11. [How to] Make partition Active or Inactive using DISKPART › Knowledge Base

    Backup & Recovery Hard Disk Manager HFS+ for Windows ExtFS for Windows Disk Wiper Professional Drive Copy Professional Migrate OS to SSD GPT Loader Paragon Alignment Tool Professional NTFS for Mac Hard Disk Manager for Mac ExtFS for Mac Manuals The system will boot from the partition only if it has Active flag set. Remember the desired disk number

  12. How to Use Diskpart to Set Boot Partition in Windows 10 New Guide]

    Step 1. Right-click the Windows icon, select "Search," and type " command prompt " into the search bar. Step 2. Select "Run as administrator" by right-clicking Command Prompt . Step 3. Type " diskpart " in the Command Prompt and click Enter. Step 4. Type the following command lines in Diskpart and press Enter each time: list disk

  13. [Full Guide] Format Disk to GPT with DiskPart

    Here, you can download EaseUS Partition Master and follow the guide to see how to format the disk to GPT in an easier way. Step 1. Download and launch EaseUS Partition Master on your computer. Step 2. Go to Disk Converter, select "Convert MBR to GPT" and click "Next" to continue. Step 3.

  14. Establish and boot to GPT mirrors in 64-bit Windows

    For help with any Diskpart.exe commands, start Diskmgmt.msc, and then open the help topics on the Help menu. The steps are performed with real examples. The steps show the expected results returned from each command. Disk 0 is the primary system and boot drive. Disk 1 is the shadow drive. Prepare the shadow drive for mirroring

  15. Help with changing active partition

    If you install Windows with GPT partition scheme. Your Boot partition is 100MB EFI System formatted as FAT32, where your BCD (Boot Configuration Data) resides in. There's no such thing as Active partition with GPT disk. EFI firmware looks for the EFI System to boot from. Active partition can only be marked as Active if your disk is initialized ...

  16. How to Make GPT Hard Drive Bootable

    Step 1. Connect the target disk to your computer and make sure it can be detected. Step 2. Type "cmd" in the search box and choose "Run as administrator". Step 3. Now you need to type the following orders one by one and press "Enter" after each: • diskpart • list disk • select disk x • clean

  17. windows

    4 Answers Sorted by: 25 +100 Only way I know how to do this is close to what @Maximus put but do the following: diskpart.exe select volume 1 detail partition The output will indicate Active: Yes/No For example: You have to go through each volume to find which ones are Active and which ones are not.

  18. How to make active@boot disk bootable on uefi/gpt?

    How to make active@boot disk bootable on uefi/gpt? Page 1 of 5 1 2 3 ... Last ancient Posts : 68 10 Pro 18 Aug 2015 #1 How to make active@boot disk bootable on uefi/gpt? Hey Guys Does anyone know how this software can be configured to boot from usb on uefi/gpt.

  19. Using Diskpart to Initialize Disk into MBR/GPT Format

    Step 1. You can press "WIN+R" and type "cmd" to open the prompt. Then, type diskpart in the prompt and press "Enter". Step 2. Type the following commands and press "Enter" after each. • list disk • select disk x • attributes cleared successfully (it can move to the next step smoothly) • online disk

  20. Guidance for Windows Recovery partition (WinRE) patching and why you

    AOMEI Partition Assistant Minitools Partition Wizard (Free) Formerly recommended Minitools Partition Wizard but they now have a paywall. If you are ok I would still recommend it. These can do everything! Acronis Partition Wizard isn't nice too old code and slow. Not optimized for SSD / NVMe. Both recommendable tools are available through winget.