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.

How to change GPT partition type on windows?

The GPT format introduce far more place to metadata. To set a partition type in diskpart, one use :

But how to do change the type after partition creation like changing primary to efi ?

user2284570's user avatar

  • note it doesn’t have to be done with diskpart, other built‑in tools can be used. –  user2284570 Jan 8, 2016 at 21:54
  • Please could you stick to standard ANSI text and refrain from using Unicode "lowercase capitals" or similar. It makes it impossible to search for your questions as "normal" search terms (non Unicode) will not be matched in your questions. This makes it harder for future visitors to find your question and thus reduces the audience of people who might be able to help you. –  Mokubai ♦ Jan 8, 2016 at 22:03
  • Change the type to what exactly? There is only one type of GPT partition. –  Ramhound Jan 8, 2016 at 22:09
  • @Ramhound : for example convert unknown to efi . A ɢᴘᴛ partition have types set has flags (you can combine several types)  ; associated ᴏꜱ ; id ; and guid. –  user2284570 Jan 8, 2016 at 22:10
  • I don't believe diskpart has the capability. –  Ramhound Jan 8, 2016 at 22:16

3 Answers 3

DiskPart can actually do this. Select the appropriate disk and partition, then use the set id command. For example, this changes the selected partition into an EFI partition:

Using a combination of the set id TechNet article and detail partition , I discovered these common possible values:

  • Recovery: de94bba4-06d1-4d40-a16a-bfd50179d6ac
  • Normal: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
  • EFI: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
  • Reserved: e3c9e316-0b5c-4db8-817d-f92df00215ae

It's probably a good idea to consult the partition attributes for a partition of a certain type (look at a healthy computer) so the set flags make sense. As you discovered, gpt attributes sets flags; detail partition displays them.

Danger zone: setting the Reserved type

The TechNet documentation says that DiskPart won't let you make a partition into a Microsoft Reserved one. That claim is true, so you might want to use a different tool. If you really want to use DiskPart, you'll have to whack the Windows disk management infrastructure it so that it doesn't know what types are not allowed. Danger! I have not tested the following steps on a bootable disk; they're here for entertainment purposes only. Do them at your own risk, preferably on a throwaway computer or VM.

Break out a hex editor - I like XVI32 - and open a copy of vdsbas.dll (in System32). That's the module that serves most disk-related operations, and it's the one responsible for policing partition types. The GUID of the Microsoft Reserved type starts at byte 0x21CD8 for the version that comes with Windows 10 x64; you should search for the hex string 16 E3 C9 E3 (0xE3C9E316 in little-endian). Flipping a bit there will make the whacked copy not know you're setting a special type. You'll have to change the security settings on the original copy of vdsbas.dll before Windows will let you overwrite it. You'll also have to make sure the Virtual Disk service isn't running (stopping it in Services is fine), otherwise the file will be in use.

Note that such Reserved partitions must not be associated with a volume. I do not know whether DiskPart has a way to keep a partition that way.

There's probably a good reason Microsoft doesn't let you set this type, so make a back-up of anything important on the drive if you decide to go this route. If you direly need such a partition back, it's probably better to reinstall/repair Windows from official media.

Ben N's user avatar

  • 1 Ok, I thought set id was referring to an unique identifier much like ɢᴜɪᴅ instead of a type. –  user2284570 Jan 8, 2016 at 23:47
  • The microsoft reserved partition need to to carry a name in more the specific id. If it don’t you won’t be able to upgrade the windows® version without re‑installing. –  user2284570 Jan 11, 2016 at 1:36
  • Note a full list of Microsoft-documented guids for GPT partitions is available here: magnumdb.com/search?q=PARTITION_%2A+AND+valuetype%3ASystem.Guid –  Simon Mourier Nov 13, 2018 at 19:38

There seems to be a bit of confusion, or at least imprecise use of terminology, in this question and its discussion. Thus, it may be useful to review the GPT data structures, which are described in the Wikipedia article on GPT. (The EFI spec is more authoritative, and is freely available, but requires accepting license terms to download. See here to get it.) GPT type codes are actually GUID values -- see the partition type GUIDs table in the Wikipedia article for a listing of well-known values. There are also GPT attributes and partition names; these are three entirely independent data structures (although many partitioning tools set partition names based on the type code). I know of no GPT partition type called "primary." I suspect that the reference to this type is a result of confusion with MBR partitions, which can be primary, extended, or logical; but these concepts are meaningless in GPT. Some tools continue to apply the term "primary" in reference to all GPT partitions, presumably because the tools were originally written for MBR disks, and so require a primary/extended/logical identification for all partitions.

Type codes, in both MBR and GPT, identify the intended use of the partition. Windows, OS X, and some other OSes use type codes as a sort of "filter" -- these OSes ignore partitions that aren't of certain types, so that you can set up (say) a Linux filesystem on a partition with a Linux-specific type code and Windows won't try to format it. There are also several Windows-specific type codes (see the Wikipedia table), and some that are cross-OS (like the code for the EFI System Partition, or ESP).

Attributes are less commonly used (type codes are mandatory), but they may modify the way the OS or firmware treats the partition. A "hidden" attribute, for instance, tells the OS to ignore the partition. This may or may not be honored, depending on the OS. Attributes can vary from one partition type to another.

Partition names exist mainly for human consumption, so that you can identify partitions. I haven't investigated it extensively, but I think that OS X is finicky about the name assigned to its Recovery HD partition; in my (brief) tests, it flaked out when this partition was renamed. I haven't encountered any other case of OSes or utilities caring about partition names, although they're often assigned to descriptions associated with the type code when partitions are created.

I'm not very familiar with Microsoft's diskpart tool, but as Ben N specifies in his answer, it it possible to use it to set type codes to arbitrary GUID values. Other tools can do this, too, or can set type codes in some other way. My own GPT fdisk ( gdisk ), for instance, uses four-digit (two-byte) hexadecimal values as "shortcuts" to known GUID values; or you can enter GPT values "raw." See the gdisk Walkthrough section of the documentation for information on how to do this. The libparted library (which is used by several Linux tools) sets type codes based on the filesystem you say will be used on a partition; but you can change them to a limited extent by setting "flags," some of which correspond to type codes and some to attributes. This is a rather confusing blending of two independent underlying data structures.

Rod Smith's user avatar

  • 1 The Microsoft windows® reserved partition need to to carry a name or it will won’t be possible to upgrade the windows® version without re‑installing. id and ɢᴜɪᴅs are 2 different independent things with 2 different values for each partition. –  user2284570 Jan 11, 2016 at 1:38
  • If you just want to see these values in gdisk without looking anywhere else: gdisk /dev/sdX . Select the extra functionality (experts only) menu (press x ) and then press i to show detailed information on a partition . You need to do it one partition at a time (perhaps there is a better way?) –  starfry Jul 3, 2018 at 13:40

Cygwin's fdisk can change the partition type. (I would guess that WSL will let you do this too, but I have neither tried nor checked.) Disk devices are typically named /dev/sda (first disk) through /dev/sdz (26th disk). Here is how I changed the partition types for my second external disk, /dev/sdc :

Start with a Cygwin administrator's shell. I'll interleave commands and output here. Output will be indented. I use the # symbol on a line to start a comment that you must not copy/enter:

Repeat the process for each partition in turn until you have changed them all to the appropriate values:

Finally, write the changes to the disk:

Note that this will allow you to set Microsoft Reserved partition type. At least for the partition label.

Chris Davies's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged windows uefi gpt diskpart ..

  • The Overflow Blog
  • Down the rabbit hole in the Stack Exchange network
  • 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

  • Can DCO be used in BSL?
  • Which source shows the Gamorrahs for each pasuk in the Chumash?
  • Is a randomly generated 80-bit password strong enough nowadays?
  • Magic: the Gathering – Scry-sort
  • Why did nobody ever succeed in "clean room" cloning the Apple Macintosh
  • Were any U.S. founding fathers present at the storming of the Bastille?
  • Computable syntax
  • Can a decimal that is infinitely repeating in one base be nonrepeating in another?
  • Is there any performance penalty to unsigned integer underflow?
  • Is there global law that governs Denaturalization to stateless status for children?
  • Does or could ChatGPT understand text?
  • Horror short story set on Everest, where climbers left behind are eaten by a creature masquerading as a climber
  • Is there a name for the widespread logical fallacy in which you prove your point by 'eliminating' anyone who contradicts you?
  • Recursive macros revisited
  • Is one hour enough for a connection in Bogota?
  • Is it very uncommon to see snakes in the woods, or have I just been unobservant?
  • Compensation for cancelled flight for multiple passengers
  • Equation of Motion Invariance in Galilean Mechanics
  • Why mesh looks different in object and edit modes?
  • Why use PySCF/OpenMolcas instead of VASP/QuantumESPRESSO
  • Should the high frequency filter be implemented in the differential signal or is afterward ok?
  • Why did PC users need partitions in the 1980's
  • 1990s/2000s live-action show with kids in tribes in a dystopian sci-fi/fantasy setting
  • What is the "-z" file on my system?

diskpart set gpt attributes

  • iPhone 15 Plus vs. Pro Max
  • 3 Key Tech Trends to Watch in 2024

Diskpart Command

Use the 'diskpart' command to manage hard drive partitions

diskpart set gpt attributes

  • Emporia State University

In This Article

Jump to a Section

  • Availability

Related Commands

The diskpart Command Prompt command is used to create or delete partitions on hard drives .

Diskpart Command Availability

The diskpart command is available from within the Command Prompt in Windows operating systems, including Windows 11, 10, 8, etc.

You can also access this command from the Recovery Console in Windows 2000 and Windows XP.

Managing partitions is also possible without the use of a command from within any version of Windows using the Disk Management tool, or free disk partition software .

Diskpart Command Syntax

diskpart < parameter >

The availability of certain diskpart command switches and other syntax may differ from operating system to operating system. See  How to Read Command Syntax  if you're not sure how to read the syntax as it's described in this table.

Diskpart Command Examples

Here are some examples showing how the diskpart command can be used:

Create 5 GB Partition

In the above example, the diskpart command creates a 5,000 MB partition on the hard drive located at \Device\HardDisk0 .

Delete Partition by Name

For this one, the diskpart command will remove the Partition1 partition located on the hard drive \Device\HardDisk0 .

Delete Partition by Letter

This command will remove the partition currently assigned the drive letter G .

Select a Disk

Finally, in this multipart command, diskpart is being used to select a particular disk, disk 1 in this example, so we can remove the readonly attribute that's been set on it.

The fixboot , fixmbr , and bootcfg commands are often used with the diskpart command.

Get the Latest Tech News Delivered Every Day

  • Fixboot Command (Recovery Console)
  • More Command
  • Rename Command
  • Dir Command
  • Fixmbr Command (Recovery Console)
  • Copy Command
  • Bootcfg Command
  • Format Command
  • AOMEI Partition Assistant Standard Edition v10.3.0 Review
  • Net User Command (Examples, Options, Switches, & More)
  • Del Command
  • How to Remove Write Protection on a Micro SD Card
  • The 34 Best Free Data Destruction Tools of 2024
  • Expand Command
  • Net Send Command
  • 10 Best Free Disk Partition Software Tools

Disk Administration, Partition a disk.

DiskPart can be used to automate disk-related tasks, such as creating volumes or converting disks to dynamic disks. Scripting these tasks is useful if you deploy Windows by using unattended Setup or the Sysprep tool, which do not support creating volumes other than the boot volume.

When using the DiskPart command as a part of a script, we recommend that you complete all of the diskpart operations together as part of a single diskpart script. To run consecutive diskpart scripts, allow at least 15 seconds between each script for a complete shutdown of the previous execution before running the DiskPart command again in successive scripts. Otherwise, the successive scripts might fail. Add a pause between consecutive DiskPart scripts by adding a TIMEOUT /t 15 command to the batch file.

When setting up a new drive, create in this order: Create Partition, Format drive, Assign drive letter.

When selecting a volume or partition, you can use either the number or drive letter or the mount point path.

The Windows GUI interface can also be used to assign a mount-point folder path to a drive. In Disk Manager , right-click the partition or volume, and click Change Drive Letter and Paths , then click Add and then type the path to an empty folder on an NTFS volume.

The Windows Recovery Console , includes a simplified DISKPART command. It only provides functionality for adding and deleting partitions, but not for setting an active partition.

Always back up the hard disk before running DiskPart.

The default SAN policy in Windows Server 2008 / R2 is now VDS_SP_OFFLINE_SHARED for all non boot SAN disks. This means that the disks will be offline at server startup (even if the drive contains a paging file).

This Disk Management error message indicates that the drive is offline:

"the disk is offline because of policy set by an administrator".

Query the current SAN policy to see if it is Offline Shared

DISKPART.EXE DISKPART> san SAN Policy : Offline Shared

To manually bring the disks online: Computer Management ➞ Storage ➞ Disk Management , right-click the disk and choose Online .

If these are not part of a cluster, than an alternative is to make a SAN policy change, select the offline disk, clear its readonly flag and bring it online:

“Divide et impera” ~ Latin saying (Divide and conquer)

Related commands

docs.microsoft.com - Configure UEFI/GPT-Based Hard Drive Partitions using Windows PE and DiskPart. docs.microsoft.com - Configure BIOS/MBR-Based Hard Disk Partitions using Windows PE and DiskPart. FORMAT - Format a disk. FSUTIL - File and Volume utilities. DISKSHADOW - Volume Shadow Copy Service. REAGENTC - Configure Windows Recovery Environment (Windows RE) and System Reset. SYSPREP - (Generalize) a Windows installation. PowerShell equivalents: clear-disk , get-disk, set-partition, get-volume Partition Wizard - GUI Disk Partition Manager. Equivalent bash command (Linux): fdisk - Partition table manipulator for Linux.

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 attributes

Total downloads

Page content

About the Author

Hot topics in 2023.

diskpart set gpt attributes

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 attributes

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 attributes

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 attributes

Copyright ©   EaseUS. All rights reserved.

The Best Windows Disk Partition Manager and PC Optimizer

diskpart set gpt attributes

  • DiskPart Command Line Utility >

DiskPart: Convert to GPT in Windows 11, 10, 8, 7

In this post, you will learn how DiskPart convert to GPT from MBR disk in detailed steps. In addition, you can use a better tool to convert MBR to GPT without losing data in Windows 11, 10, 8, and 7.

Cherry

By Cherry / Updated on August 11, 2023

twitter

What are MBR and GPT disks?

MBR & GPT

MBR and GPT are two different disk partition styles. Only when the hard disk is initialized with the partition style set, can it be used to store data, including the operating system. Compared with MBR, GPT is a new partition style, breaking through MBR's limitation on hard disk capacity (only 2TB) and the number of primary partitions (only 4 primary partitions), so more and more people choose GPT.

The difference between MBR and GPT are as follows:

● GPT supports a disk larger than 2 TB in size while MBR cannot. ● MBR booted by Legacy BIOS, GPT booted by UEFI. ● A GPT disk supports volumes up to 18EB and 128 partitions per disk while the MBR disk supports 2TB in size and 4 primary partitions at most. ● GPT partitioned disks have redundant primary and backup partition tables for improved partition data structure integrity. ●  Some Windows systems can only run on MBR or GPT disk, you can find them in the list we show you above. If you plan to upgrade to Windows 11, Windows 11 only supports UEFI boot mode. So you'd better convert the MBR system disk to GPT for Windows 11 .

Therefore, to increase partition size, be compatible with UEFI, or get more partitions, some users want to convert their MBR disk to GPT.

Factors to consider before converting

Before converting the partition style of your disk, please pay attention to these factors. First, you need to ensure that your system supports the partition style you intend to convert to. For example, if you want to convert to GPT, your computer should have UEFI firmware.

It is crucial to back up all your important data before proceeding with the conversion process to avoid any potential data loss. Besides, please check the system requirements of your operating system and software to ensure compatibility with the desired partition style. Some older operating systems may have limited support for GPT.

How to use DiskPart to convert to GPT

DiskPart is a command-line disk partitioning utility provided by Microsoft. It allows users to manage disks, partitions, and volumes on Windows operating systems. With DiskPart, you can perform various operations such as creating, deleting, formatting, and resizing partitions. Also, it supports converting MBR/GPT to MBR/GPT. You can refer to the following steps:

Step 1.  Press the " Windows + R " key simultaneously, and input " diskpart " in the box. Press Enter.

Step 2.  Input " list disk " to list all disks connected to your computer and press Enter.

Step 3.  Input “ select disk n ”(n is the number of MBR disk)to select the MBR disk you want to convert to GPT and press Enter.

Step 4.  Input " clean " to delete all partitions existing on the target disk and press Enter ( backup in advance).

Step 5.  Input " convert gpt " and press Enter.

Diskpart Convert GPT

After that, input " exit " to exit Diskpart.

Alternative to DiskPart: convert MBR to GPT without data loss

Although using DiskPart to convert MBR to GPT is easy, it is still difficult for ordinary users, because entering the command prompt is not for everyone. And its biggest drawback is that it needs to clear all the data on the hard disk, and it cannot convert the system to GPT when Windows is running, because it does not support clean system disk data.

To solve these problems, I suggest you use AOMEI Partition Assistant Professional . This powerful MBR to GPT converter can be a great alternative for DiskPart. It allows you to convert MBR to GPT and vice versa without clearing the data. More importantly, its operation is very simple, it only takes three steps to achieve conversion.

What’s more, it goes beyond converting disk to GPT- provides various tools to help users manage their disk partitions efficiently. It also has useful functions like Allocate free space , Shred files or folders, Wipe hard drives, Migrate OS to another disk, Recover lost data, etc.

Please download the Demo to see how to convert MBR to GPT in Windows 11/10/8/7.

Step 1. Install and launch the AOMEI Partition Assistant Professional. After opening it, select the target disk and then click “Convert”  at the top toolbar. Select the “Convert MBR/GPT”  option.

Convert System Disk To Gpt

Step 2. Ensure you have converted Legacy BIOS to UEFI, and click “Yes” to confirm.

Ok To Gpt System Disk

Step 3. In the main interface of AOMEI Partition Assistant, click “Apply” to start the conversion.

Apply To Gpt System Disk

And wait for the operation to complete. After that, you can go to “This PC” and open the “Properties”, and you will see the partition table has become GPT. If you are converting a system disk, you need to change the BIOS to UEFI  to boot the GPT system disk when restarting.

FAQs about convert disk to GPT

✎ Q1: Is it possible to convert a disk to GPT without losing data?

Yes, it is possible to convert a disk to GPT without losing data. However, it is crucial to back up your data before attempting the conversion process to avoid any potential loss.

✎ Q2: Can I convert the system disk to GPT?

Yes, you can convert the system disk to GPT. However, please note that the process requires additional steps and precautions. It is highly recommended to consult the official documentation or seek professional assistance when converting the system disk.

✎ Q3: Will converting a disk to GPT improve performance?

While converting a disk to GPT itself does not directly improve performance, it unlocks the benefits of GPT, such as support for larger partition sizes and more robust data structures. These advantages can indirectly contribute to better performance, especially in modern systems.

✎ Q4: Can I convert a GPT disk back to MBR?

Yes, it is possible to convert a GPT disk back to MBR. However, the process involves deleting all existing partitions, which will result in data loss. Therefore, it is crucial to back up your data before attempting the conversion.

✎ Q5: Is there any risk involved in converting a disk to GPT?

While converting a disk to GPT is generally a safe process, there are potential risks, such as data loss if not performed correctly. It is essential to follow the instructions carefully and back up your data beforehand to minimize any potential risks.

Do you know how to convert GPT via DiskPart now? Upon perusing this guide, you will recognize that employing AOMEI Partition Assistant represents the most straightforward approach for converting MBR to GPT without data loss, when compared to the other four solutions. Through this tool, you gain the capability to seamlessly convert between MBR and GPT formats, avoiding the necessity to delete any existing partitions.

By the way, if you are trying to use it in Windows Server, please upgrade to AOMEI Partition Assistant Server .

Cherry

Related Articles

Convert disk from gpt to mbr with diskpart.

Need to use Diskpart convert MBR in Windows 11/10/8/7? This article will show you how to do it and another easier way will be introduced too which can convert GPT to MBR without data loss.

How to Convert Boot Disk Between MBR and GPT Styles?

How to convert boot disk between MBR and GPT styles securely? Read on, and you’ll find the most powerful disk management software to help with MBR-GPT conversion without data loss.

How to Convert GPT to MBR or Convert MBR to GPT without Losing Data?

This paper gives a brief introduction of MBR and GPT and tells you how to convert GPT to MBR without losing data or without the operating system in Windows 11,10, 8, and 7 computer step by step.

Free Download to Try AOMEI Partition Assistant Now

diskpart set gpt attributes

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

Win 10 1903, DiskPart command 'convert gpt' automatically creates an MSR partition at the beginning of the disk.

Tired of running out of space in the recovery partition and get windows image shadow copy error 0x80780119 , I was just trying out the script to prepare the GPT partitions for windows 10 installation, but rather than using WinPE I just used the DiskPart command on a running windows 10 v 1903 or 20H1 and I noticed that using the script suggested by Microsoft at this link:

https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions

I ended up with 2 MSR partitions instead of one.  The 1st Reserved partition was created directly after the command 'convert gpt'

This does not happen if the same script is started from the command prompt of the installation media.

I did not see any documentation stating that the command 'convert gpt' was automatically creating an MSR partition and it was just a surprise to see that it behaves differently depending on the environment. I assume that is fine for a GPT disk that only has data partitions after the MSR, but not good for a windows system disk.

To work around the problem and running the script on a live system I had to add 2 lines right after the "convert gpt"  

select partition 1

delete partition override

and then continue with the rest of the script.

 Results sample with a 64GB disk before the workaround:

Disk 7 is now the selected disk.

DISKPART> list partition

  Partition ###  Type              Size     Offset   -------------  ----------------  -------  -------   Partition 1    Reserved            15 MB    17 KB                           <-------- Created automatically with command 'convert gpt'   Partition 2    System             100 MB    16 MB   Partition 3    Reserved            16 MB   116 MB   Partition 4    Primary               58 GB   132 MB   Partition 5    Recovery          1000 MB    58 GB

DISKPART>

rem == CreatePartitions-UEFI.txt == rem == These commands are used with DiskPart to rem    create four partitions rem    for a UEFI/GPT-based PC. rem    Adjust the partition sizes to fill the drive rem    as necessary. == select disk 7 clean convert gpt

rem   added following 2 lines to work around the duplicate MSR

select partition 1 delete partition override

rem == 1. System partition ========================= create partition efi size=100 rem    ** NOTE: For Advanced Format 4Kn drives, rem               change this value to size = 260 ** format quick fs=fat32 label="System" assign letter="S" rem == 2. Microsoft Reserved (MSR) partition ======= create partition msr size=16 rem == 3. Windows partition ======================== rem ==    a. Create the Windows partition ========== create partition primary rem ==    b. Create space for the recovery tools === rem       ** Update this size to match the size of rem          the recovery tools (winre.wim) rem          plus some free space. shrink minimum=1000 rem ==    c. Prepare the Windows partition ========= format quick fs=ntfs label="Windows" assign letter="W" rem === 4. Recovery tools partition ================ create partition primary format quick fs=ntfs label="Recovery tools" assign letter="R" set id="de94bba4-06d1-4d40-a16a-bfd50179d6ac" gpt attributes=0x8000000000000001 list volume exit

Same 64GB disk sample after adding the 2 lines in the script.

  Partition ###  Type              Size     Offset   -------------  ----------------  -------  -------   Partition 1    System             100 MB  1024 KB   Partition 2    Reserved            16 MB   101 MB   Partition 3    Primary               58 GB   117 MB   Partition 4    Recovery          1000 MB    58 GB

Actual windows disks with increased recovery partition to 1000 MB:

DISKPART> select disk 0

Disk 0 is now the selected disk.

  Partition ###  Type              Size     Offset   -------------  ----------------  -------  -------   Partition 1    System             260 MB  1024 KB   Partition 2    Reserved            16 MB   261 MB   Partition 3    Primary            475 GB   277 MB   Partition 4    Recovery          1000 MB   475 GB

diskpart set gpt attributes

24 people found this helpful

Report abuse

Was this discussion helpful? Yes No

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this discussion?

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

Thanks for your feedback.

Replies (0) 

Discussion info.

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

This browser is no longer supported.

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

PARTITION_INFORMATION_GPT structure (winioctl.h)

Contains GUID partition table (GPT) partition information.

PartitionType

A GUID that identifies the partition type.

Each partition type that the EFI specification supports is identified by its own GUID , which is published by the developer of the partition.

This member can be one of the following values.

PartitionId

The GUID of the partition.

The Extensible Firmware Interface (EFI) attributes of the partition.

This member can be one or more of the following values.

A wide-character string that describes the partition.

The GPT partition format is required for disks that are used to boot computers that use Extended Firmware Interface (EFI) firmware. GPT data disks can reside on x86, x64, and Itanium-based architectures.

Starting with Windows Server 2003 with SP1, GPT is supported on all Windows platforms, not only platforms that use EFI.

Requirements

File System Recognition

IOCTL_DISK_GET_PARTITION_INFO_EX

IOCTL_DISK_SET_PARTITION_INFO_EX

PARTITION_INFORMATION_EX

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

IMAGES

  1. DiskPart: Convert to GPT in Windows 11, 10, 8, 7

    diskpart set gpt attributes

  2. Diskpart gpt active

    diskpart set gpt attributes

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

    diskpart set gpt attributes

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

    diskpart set gpt attributes

  5. diskpart set boot partition windows 10 Archives

    diskpart set gpt attributes

  6. DISKPART

    diskpart set gpt attributes

VIDEO

  1. python selenium find div by class name

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

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

  4. Solusi Harddisk GPT PROTECTIVE PARTITION

  5. Check disk partition gpt or mbr windows 10#gptormbr#gpt#mbr#dasktop#laptop#win10#windows10

  6. How To Format A Drive With Diskpart!

COMMENTS

  1. How to change GPT partition type on windows?

    7. The GPT format introduce far more place to metadata. To set a partition type in diskpart, one use : DISKPART> create partition msr. or. DISKPART> create partition efi. or. DISKPART> create partition primary.

  2. 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.

  3. diskpart

    gpt: Assigns the gpt attribute(s) to the partition with focus on basic GUID partition table (gpt) disks. help: Displays a list of the available commands or detailed help information on a specified command. import: Imports a foreign disk group into the disk group of the local computer. inactive

  4. gpt

    Description. attributes= <n>. Specifies the value for the attribute that you want to apply to the partition with focus. The gpt attribute field is a 64-bit field that contains two subfields. The higher field is interpreted only in the context of the partition ID, while the lower field is common to all partition IDs. Accepted values include:

  5. DISKPART

    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 ...

  6. Diskpart Command (Examples, Options, Switches & More)

    The diskpart command is used to add and delete hard drive partitions. ... gpt: Assigns the gpt attribute(s) to the partition with focus on basic GUID partition table (gpt) disks. ... diskpart is being used to select a particular disk, disk 1 in this example, so we can remove the readonly attribute that's been set on it. How to Remove Write ...

  7. DiskPart

    GPT attributes=n (Windows Server 2012-2022) OEM use only. On basic GUID partition table (gpt) disks, this command assigns the gpt attribute(s) to the partition with focus. Gpt partition attributes give additional information about the use of the partition. Some attributes are specific to the partition type GUID.

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

    Then, select "Initialize Disk" in the pop-out menu. Step 2. Select to initialize the disk to MBR/GPT. Click "OK". Step 3. Click " Apply" at the toolbar to confirm the operations. The AOMEI Partition Assistant initializing disk with an intuitive interface is much simpler than using Windows Diskpart to initialize disk.

  9. [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.

  10. How to use DISKPART commands in Windows 11/10

    Open Diskpart command in the Command Prompt. Type list disk and press Enter. Select the Disk you want to clean using select disk <no>. Type clean, and press the Enter key. Make sure not to use the ...

  11. set id

    override. forces the file system on the volume to dismount before changing the partition type. When you run the set id command, DiskPart attempts to lock and dismount the file system on the volume. If override isn't specified, and the call to lock the file system fails (for example, because there is an open handle), the operation fails.

  12. DiskPart: Convert to GPT in Windows 11, 10, 8, 7

    Press the " Windows + R " key simultaneously, and input " diskpart " in the box. Press Enter. Step 2. Input " list disk " to list all disks connected to your computer and press Enter. Step 3. Input " select disk n "(n is the number of MBR disk)to select the MBR disk you want to convert to GPT and press Enter. Step 4.

  13. How can I unhide a gpt volume?

    To run Command Prompt as an administrator. a) Click the Start button. b) In the search box, type command prompt. c) In the list of results, right-click Command Prompt, and then click Run as administrator. If you're prompted for an administrator password or confirmation, type the password or provide confirmation.

  14. attributes volume

    Remarks. On basic master boot record (MBR) disks, the hidden, readonly, and nodefaultdriveletter parameters apply to all volumes on the disk.. On basic GUID partition table (GPT) disks, and on dynamic MBR and gpt disks, the hidden, readonly, and nodefaultdriveletter parameters apply only to the selected volume.. A volume must be selected for the attributes volume command to succeed.

  15. Diskpart

    Diskpart - Set Id for WinRE Partition. I have erased a hard disc and re-partitioned it. This is for UEFI and GPT along with a new installation of Windows 10 Pro - the most current version. I created all of the partitions successfully. But when I tried to set the id for the WinRE partition I was not able to.

  16. Win 10 1903, DiskPart command 'convert gpt' automatically creates an

    DISKPART> rem == CreatePartitions-UEFI.txt == rem == These commands are used with DiskPart to rem create four partitions rem for a UEFI/GPT-based PC. rem Adjust the partition sizes to fill the drive rem as necessary. == select disk 7 clean convert gpt. rem added following 2 lines to work around the duplicate MSR. select partition 1

  17. attributes disk

    In this article. Displays, sets, or clears the attributes of a disk. When this command is used to display the current attributes of a disk, the startup disk attribute denotes the disk used to start the computer. For a dynamic mirror, it displays the disk that contains the boot plex of the boot volume.

  18. PARTITION_INFORMATION_GPT

    This attribute can be set for basic and dynamic disks. If it is set for a partition on a basic disk and the disk is converted to a dynamic disk, the partition remains a basic partition, even though the rest of the disk is a dynamic disk. This is because the partition is considered to be an OEM partition on a GPT disk.