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
  • Would you trust an AI bot to find the fix for vulnerabilities in your code?
  • 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

  • Has the Niger junta explained why they expelled French but not US troops?
  • Isn't there another word for someone who puts together scissors?
  • Filler word or phrase to skip details that aren't important
  • Is it fine to email several people regarding internship programs and potentially have to turn down one?
  • What was the ‘obvious’ new answer to Asimov’s Pâté de Foie Gras made possible by scientific advance?
  • Which type of female connector is this?
  • Make a single object transparent in viewport shading
  • I've hit the limit of what ChatGPT can teach me about game development in GDScript — what strategies can I use to keep making progress?
  • Median of a set with even number of elements
  • A co--ection of images
  • Is it okay for a co-author to share an unfinished manuscript with others?
  • How do I compute a probability from the MGF?
  • Can I take a gas canister on the MS Sarfaq Ittuk ferry?
  • Is there a word for an object orbiting a brown dwarf?
  • Is it possible to dynamically refresh journalctl with less?
  • Based on ranges, for a given number, I want to increment it by another number
  • How does EXT4 handle sudden lack of space in the underlying storage?
  • What is the most logical way to have my dragon breathe lightning?
  • How is this "bread" puffing up without yeast or baking soda?
  • Do you say "give a sociable compliment" when you mean you give a compliment as a way to socialize with people but it's not a true praise?
  • Does RMS value of AC signal depend on frequency?
  • Fingering for left hand accompaniment over two octaves piano
  • Is it legal for a bank to trap you in an ATM vestibule?
  • Could Israel's PM Netanyahu be served with an arrest warrant from the ICC for war crimes, like Putin was because of Ukraine?

diskpart set filesystem type

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 Alienware Pro Wireless Gaming Keyboard review: Alienware is starting to get REALLY good at this
  • 3 Game the system and buy an Xbox Series X for a lower price than you'll see at GameStop, Amazon, or even Microsoft
  • 4 Razer goes green for gamers with "premium quality, high performance, innovative products" using recycled materials
  • 5 Alienware Pro Wireless Gaming Mouse review: The smoothest mouse I've ever used

diskpart set filesystem type

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 filesystem type

Home About Contact Us

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

  • 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 filesystem type

  • 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
  • Copy Command
  • Fixmbr Command (Recovery Console)
  • Dir Command
  • Bootcfg Command
  • Format Command
  • AOMEI Partition Assistant Standard Edition v10.3.0 Review
  • How to Fix the 'Operating System Not Found' Error
  • Net Send Command
  • Net User Command (Examples, Options, Switches, & More)
  • Del Command
  • How to Delete System Error Memory Dump Files
  • The 34 Best Free Data Destruction Tools of 2024
  • Expand Command

site logo

How to Use DiskPart Utility in Windows

Format, resize, extend and manage your drives

Author avatar

The Disk Management Tool is a useful, effective tool for managing your Windows disks and partitions, but it isn’t as powerful to use as Diskpart. This command-line tool lets you delete, create and modify partitions on any hard drives or USB storage your PC can detect.

We’d recommend using the Disk Management Tool for most situations, but if Windows isn’t starting up properly, or if you prefer to use the PowerShell terminal , Diskpart is the perfect alternative. Here are some of the more common Diskpart commands to help you learn how to use Diskpart effectively.

How to Use DiskPart Utility in Windows image 1

How To Use Diskpart

If you want to use Diskpart, you need to open up a Windows command line or PowerShell terminal. Diskpart is a destructive tool, so you’ll need to open a terminal window with the right administrative privileges.

  • To open Diskpart in Windows, right-click your Windows Start menu button and click Windows PowerShell (Admin) .

How to Use DiskPart Utility in Windows image 2

  • In your admin-level PowerShell terminal (or similar Windows command line), type diskpart and hit enter.

How to Use DiskPart Utility in Windows image 3

  • The Diskpart tool will launch within the window, ready for you to use. Type exit at the “DISKPART>” prompt and hit enter once you’ve finished using it.
  • Diskpart is also available for users booting into the Windows Recovery Environment, available when you boot your PC using the Advanced Startup mode in your Settings > Windows Update & Security > Recovery menu.
  • Click Restart Now to boot to WinRE.

How to Use DiskPart Utility in Windows image 4

We’ll explore some of the most common Diskpart commands in this article, but if you want to quickly see the full list of available Diskpart commands, type help at the “DISKPART>” prompt and hit enter.

How to Use DiskPart Utility in Windows image 5

Listing Existing Hard Drives, Volumes & Partitions

Once Diskpart is open, the first thing you should do is check the current layout of your hard drives and attached storage.

  • At the “DISKPART>” prompt, type list disk and hit enter. This will list all of the available storage drives (including hard drives, USB storage, SD cards, etc.) that your PC can currently detect.

How to Use DiskPart Utility in Windows image 6

  • Starting with the number zero, Diskpart will list any detected disks. You’ll need to remember the disk number (for instance, “0” for your Windows hard drive) to use with future Diskpart commands.
  • Along with your list of disks, you can also ask Diskpart for a list of detected volumes. At the “DISKPART>” prompt, type list volume .

How to Use DiskPart Utility in Windows image 7

  • Diskpart can also let you list individual hard drive partitions (some of which may match the volumes listed with the “list volume” command). You’ll need to select a hard disk first with the list disk command.
  • At the “DISKPART>” prompt, type select disk followed by the disk number (for instance, select disk 0 ). Diskpart will confirm that the disk is selected at this point.
  • Once a disk is selected, type list partition . This will list the current partitions on your drive. You’ll be able to delete or modify these partitions from here, using the partition number in a later Diskpart command.

How to Use DiskPart Utility in Windows image 8

Deleting a Hard Drive Partition Or Volume Using Diskpart

A hard drive (disk) is separated into partitions, which are often the same as listed volumes. If your hard drive is separated into several partitions or volumes, and you wish to delete one, you can do that using Diskpart commands.

  • Select your hard drive using select disk. 
  • At the “DISKPART>” prompt, type list partition , then select partition # , replacing # with your partition number.

How to Use DiskPart Utility in Windows image 9

  • Once a partition is selected, type delete partition . Diskpart will confirm whether or not the partition has been deleted afterward.
  • You can also delete disk volumes directly if you’d prefer.  Type list volume , locate your chosen volume number, then type select volume # , replacing # with your volume number.

How to Use DiskPart Utility in Windows image 10

  • Type delete volume to delete the volume completely. Diskpart will confirm if the command was successful or not afterward.

Wiping a Hard Drive Completely Using Diskpart Clean

Rather than removing individual volumes or partitions on a drive, you can wipe a hard drive completely using the Diskpart clean command. You can also use this command if you’re looking to wipe a USB flash drive, ready for formatting.

You won’t be able to do this on your system drive (nor would you want to!) unless you’re using Diskpart on a Windows installation

  • At the “DISKPART>” prompt, select the disk you wish to wipe by typing select disk # , replacing # with your disk number. If you don’t know your disk number, type list disk first.

How to Use DiskPart Utility in Windows image 11

  • If you’re sure you want to wipe the disk completely (deleting all drive volumes/partitions), then type clean and hit enter. You won’t be asked for confirmation, so be sure you wish to do this before you begin.

How to Use DiskPart Utility in Windows image 12

  • Diskpart will confirm that the drive has been “cleaned”, ready for new partitions to be created.

Creating & Formatting New Hard Drive Partitions  

With a “clean” drive, you’re ready to create a partition in the free space using the Diskpart create partition command. You can then format that new partition with a Windows-friendly file system like NTFS or FAT32 using the Diskpart format command.

  • Start by selecting your chosen disk with select disk #, replacing # with your disk number (and using list disk to find your disk number, if you don’t know.)
  • With your disk selected, type create partition primary to create a partition using the entire space on that drive.
  • If you want to create a partition to take up only some of the free space (letting you create more than one partition), type create partition primary size=X instead, replacing X with the partition size, measured in megabytes (for example, size=1024 for 1GB of space).

How to Use DiskPart Utility in Windows image 13

  • Type list partition to make sure that your new partition is listed, then type select partition 1 to select it. Mark the partition as active by typing active at the “DISKPART>” prompt. This is necessary if you want to use it as a bootable drive.

How to Use DiskPart Utility in Windows image 14

  • To quickly format the drive with the NTFS file system, type format fs=NTFS label=Y quick. You can replace Y with any label you’d prefer to use.

How to Use DiskPart Utility in Windows image 15

  • Once formatted, Windows will likely assign a drive letter automatically. If it doesn’t, type assign letter Z , replacing Z with a free drive letter.

How to Use DiskPart Utility in Windows image 16

Extend a Hard Drive Volume

If you have an existing hard drive volume that doesn’t take up all of the free space on a drive, and you wish to enlarge it, Diskpart commands allow you to do that.

  • Type list volume to list all the available volumes on your PC, then type select volume # , replacing # with the volume you’re looking to extend.
  • Type extend to expand it to the maximum size available. Diskpart will confirm whether or not the extend command has worked correctly.  Confirm the size of the volume has increased by typing list volume for a second time afterward.

How to Use DiskPart Utility in Windows image 17

Diskpart has other options available, as the help command briefly explains. If you need further information on how to use Diskpart, Microsoft has further Diskpart support information available.

' src=

Ben Stockton is a freelance technology writer based in the United Kingdom. In a past life, Ben was a college lecturer in the UK, training teens and adults. Since leaving the classroom, Ben has taken his teaching experience and applied it to writing tech how-to guides and tutorials, specialising in Linux, Windows, and Android. He has a degree in History and a postgraduate qualification in Computing. Read Ben's Full Bio

Read More Posts:

diskpart set filesystem type

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.

The Best Windows Disk Partition Manager and PC Optimizer

diskpart set filesystem type

  • Free Partition Software >

Change File System between NTFS and FAT32 without Formatting

Want to convert between NTFS and FAT32 without losing data? Learn to change file system on HDD, external hard drive, USB flash drive, or Pen Drive without formatting in Windows.

Lucas

By Lucas / Updated on May 12, 2023

twitter

A brief introduction of file system in Windows

The way that computers store files on disk has a close relationship with the file system which is used to control how data is stored and retrieved. File System separates all data into pieces and gives each piece a name so that the information can be easily isolated and identified. The structure and logic rules used to manage the groups of information and their names are called a file system.

There are several file systems frequently used in Windows OS including File Allocation Table (FAT), Extended File Allocation Table (exFAT), and New Technology File System (NTFS), etc.

Nowadays, FAT32 and NTFS are the most two popular file systems in Windows operating systems like Windows 7, Windows 10, Windows 11, Windows XP, and so on. Therefore, when people talk about changing file system without formatting, they basically talk about converting NTFS to FAT32 or in turn without losing data.

◤ FAT32 (File Allocation Table 32) FAT32 is an old file system first introduced by Microsoft and used as an extension of FAT16. The standard maximum volume size for FAT32 is 2TB and the maximum single file size is 4GB compare to the former version it has better performance, more flexibility, and robustness.

◤ NTFS (New Technology File System) NTFS, as its name implies, is pretty new with advanced techniques in this field. Compared to FAT32, NTFS is more powerful in data security, data consistency, read & write, and retrieval.

FAT32 & NTFS

When do you want to change partition file system without formatting?

Although NTFS is more advanced than FAT32 as covered before, it cannot replace FAT32 totally, at least presently. FAT32, as a traditional file system, is compatible with many external mediums such as XBOX, PS3, Android, and so on. So some users would like to reformat to FAT32 from NTFS sometimes for other purposes. The following real situation illustrates why they want to convert the file system.

“ All partitions’ file system is NTFS now in my Windows 7. I want to format the D drive from NTFS to FAT32 because the program I’ll use does not support backup unless it is FAT32. What can I do to change the drive file system without formatting and losing data? ”

What’s more, FAT32 has a deadly limitation that a single file should not be larger than 4GB. Thus, converting file system is a must-do event when you have large files say DVD ISO files on FAT32 partition to read, especially on a USB flash drive.

How to change a file system without formatting in Windows 11/10/8/7?

Thus, how can you change file system without formatting in Windows? Fortunately, you can complete this task with the help of third-party software like AOMEI Partition Assistant Professional .

You cannot do it without losing data using Windows Disk Management because it will format the partition at first. This software allows you to change file system on HDD, external hard drive, USB drive, Pen Drive, and so on in Windows 11/10/8/7/XP/Vista without formatting the partition. All operations will be completed within several clicks in a user-friendly interface. Don’t worry if you’re a novice to computers.

Step1 . Download, install and launch AOMEI Partition Assistant on Windows. If you want to change the file system on a flash drive, external hard drive, or like, connect it to a computer beforehand. Click on "Convert "> “Convert to NTFS/FAT32” in the top pane. 

NTFS to FAT32 Converter

Step2 . Select the convert method depending on your condition. Take NTFS to FAT32 for example.

Converter Wizard

Step3 . Select the partition you want to convert from the NTFS partition list.

Select NTFS Partition

Step4 . Click “Proceed” after confirming. It will check and start the conversion right now.

Proceed

Four steps are involved, you have changed file system without formatting in Windows. Besides, in the first screenshot you may notice that except for converting a file system, AOMEI Partition Assistant is capable of converting between dynamic disk and basic disk without data loss. Moreover, you can use it as Gptgen alternative to convert disk between MBR and GPT. If you are Windows Server OS user, AOMEI Partition Assistant Server is suitable for you.

Lucas

Related Articles

4 methods: free convert exfat to ntfs in windows 10, 8, 7 easily.

Need to format external hard drive to NTFS? In this post, you will learn how to format hard drive to NTFS file system without losing data in four different ways.

4 Ways to Format External Hard Drive to NTFS in Windows 10/8/7 Successfully

How to convert raw to fat32 using cmd with ease.

Here we show how to convert RAW to FAT32 using CMD for your reference. Then you can easily change RAW micro SD card, memory card, pen drive or USB flash drive to FAT32 file system when necessary.

Free Download to Try AOMEI Partition Assistant Now

This browser is no longer supported.

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

diskpart scripts and examples

  • 10 contributors
Applies to: Windows Server 2022, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012

Use diskpart /s to run scripts that 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.

To create a diskpart script, create a text file that contains the Diskpart commands that you want to run, with one command per line, and no empty lines. You can start a line with rem to make the line a comment. For example, here's a script that wipes a disk and then creates a 300 MB partition for the Windows Recovery Environment:

  • To run a diskpart script, at the command prompt, type the following command, where scriptname is the name of the text file that contains your script:
  • To redirect diskpart's scripting output to a file, type the following command, where logfile is the name of the text file where diskpart writes its output:

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. You can run consecutive diskpart scripts, but you must 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. You can add a pause between consecutive diskpart scripts by adding the timeout /t 15 command to your batch file along with your diskpart scripts.

When diskpart starts, the diskpart version and computer name display at the command prompt. By default, if diskpart encounters an error while attempting to perform a scripted task, diskpart stops processing the script and displays an error code (unless you specified the noerr parameter). However, diskpart always returns errors when it encounters syntax errors, regardless of whether you used the noerr parameter. The noerr parameter enables you to perform useful tasks such as using a single script to delete all partitions on all disks regardless of the total number of disks.

Related links

Command-Line Syntax Key

Sample: Configure UEFI/GPT-Based Hard Drive Partitions by Using Windows PE and DiskPart

Sample: Configure BIOS/MBR-Based Hard Disk Partitions by Using Windows PE and DiskPart

Storage Cmdlets in Windows PowerShell

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

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

How to Create Volume/Partition Using Diskpart? [Full Guide]

Diskpart is a built-in disk tutility that offers multiple ways to assist you creating partition and handling volumes in Windows 11/10. Our article shows you how to use Diskpart to create partition and other Diskpart commands that could be applied to create boot volume, system volume, dynamic volume, RAID-5 volume, Mirrored System volume, and UEFI system volume.

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

diskpart set filesystem type

What Is Diskpart

Featured Articles

  • 01 Use Diskpart to Create Volume (Boot, System, RAID, etc.)
  • 02 Use DiskPart to Delete All Partitions in Windows
  • 03 Use Diskpart to Convert GPT Disk to MBR
  • 04 Use Diskpart to Merge Partitions
  • 05 Best Diskpart Alternatives for Windows 11/10/8/7
  • 06 Use Diskpart to Fix Device Read Only Issue
  • 07 Troubleshooting 1: Fix DiskPart I/O Device Error in Windows 10/8/7
  • 08 Troubleshooting 2: Fix Diskpart Has Encountered an Error Access Is Denied
  • 09 Troubleshooting 3: Fix Diskpart Failed to Clear Disk Attributes
  • 10 Troubleshooting 4: 8 Fixes to Remove System Cannot Find the File Specified Error
  • 11 Troubleshooting 5: How to Fix DiskPart Virtual Disk Service Errors
  • 12 Diskpart Delete Partition Override Not Working
  • 13 Diskpart Clean Not Working on Disk/USB/SD Card

This page covers multiple Diskpart commands, you can apply to create partitions and volumes using Diskpart as shown here:

How Do I Create a New Volume in Diskpart

Diskpart , also known as Windows built-in free disk utility, it presents Windows users with multiple features in managing disk partitions, fixing device errors, programming, developing, and testing, etc. Due to its high accessibility, free-to-use, and flexibility, Diskpart is popular among Windows users for manaing hard drive partitions.

If your partitions are not well managed, your system may have a lot of free unallocated space. Therefore, Windows users oftern use the Diskpart create partition command to manage their system drives and storage devices.

There are different types of partitions that you can create in Windows. You can do it all using Diskpart to create partitions in Windows 11/10 with different commands no matter the partition type.

Here, our article will show you an in-detail step-by-step guide to using Windows diskpart command to create partitions.

There are detailed guides on how to use Diskpart to create different volumes. Share this article to help other users having the same issues.

#1. Use Diskpart to Create Partition/Volume

Diskpart create partition is a built-in command in Windows operating system. Using this command, you can manage, create, and edit your partitions in Windows OS. Let's see below how to create different partition volumes using the diskpart command.

1. Create System Volume, Primary Partition Using Diskpart

Diskpart command also allows you to create system volume. System volume, also known as the primary partition, which is the place where your operating system and propgrams are installed.

Follow the below steps to create system volume using the diskpart command:

Step 1: Open CMD on your Windows computer.

Step 2: Enter diskpart and then Type  list disk.

Step 3: Select a disk using the select disk x command. (Replace x with the number of the disk you wish to select)

Step 4: Type the command create partition primary size=20480  to initialize a new partition with a size.

Entering the above will create a primary system volume partition. If you need to create a logical partitoin, replace  create partition primary with  create partition logical . Also, you can change the size according to your needs.

create system volume

Step 5.  Type  exit  to close Diskpart when the process completes.

After creating a system volume partition, you can clean install a Windows or applications in it.

related articles

[Infographic] Create Partition Using Diskpart, Disk Management, and Software

Alongside Diskpart, you can also create partition using Disk Management or third-party partition manager software like EaseUS Partition Master. Follow this guide to learn the difference and detailed steps.

Create partition using software

2. Create Boot Volume Using Diskpart

Boot volume is the primary partition of your operating system. It's also known as a bootable partition. All your operating system files are stored in this partition. In simple terms, your operating system resides in the boot volume portion.

To allow computer load the boot information, you'll also need to mark the boot volume active. Follow the below steps to create a boot volume using the diskpart command in Windows operating system:

You can do that by pressing the "Windows + R" key, which will open a Run box. Type  cmd  and hit OK .

opening cmd

Step 2: In CMD, enter the diskpart  command and open the diskpart utility.

Step 3: Type  list disk  and press enter to list all your disks.

Step 4: Select a disk using   the  select disk x command. (Replace x with the number of the disk you wish to select)

Step 5: Enter the list volume  command to see available volumes for your disk.

Step 6: Enter the select volume n command to select the volume you wish to make as a boot partition. (n is the number for your volume)

Step 7: Enter the active  command, and you will have the specified volume as a boot partition.

Now, exit CMD, and restart your system to see the changes.

create boot volume

3. Create Dynamic Volume Using Diskpart

Dynamic volume disk allows you to manage your disks with more flexibility.

You don't have to specify a size while creating a dynamic partition disk. Your disk can evolve and grow over time.

Follow the below steps to create a dynamic volume using the diskpart command:

Step 2: Type  diskpart.

Step 3: Type  list disk.

Step 4: Type  list volume.

Step 5: Select a disk using the select disk x command. (Replace x with the number of the disk you wish to select)

Step 6: Type the convert dynamic  command to convert your selected volume to a dynamic volume.

convert dynamic

4. Create RAID-5 Volume via Diskpart Commands

RAID-5 (A redundant array of independent disks) is a type of disk volume that efficiently utilizes your storage. Along with better storage management, it gives you good security and disk performance.

Follow the below steps to create RAID-5 volume using the diskpart command:

Step 3: Type  list disk to see your current disk numbers.

Step 4: Enter create volume raid disk=1 (Here 1 is the disk number that you are creating as RAID-5 volume. You can change this number with other disk numbers).

diskpart create raid volume

5. Create Mirrored System Volume

The mirrored system partition allows you to create a clone of data from another volume. Primarily, users need it for creating backup device data. Follow the below steps to create mirrored system volume using diskpart:

Step 3: Type  list disk and then a select disk which volume you want to mirror by selecting disk x  command.

Step 4: Type  list volume to list the volume of the selected disk.

Step 5: Now, type the select volume c  command to choose the volume you want to mirror to a disk. (replace c with the volume alphabet of your choice)

Step 6: Enter the command add disk=x  (replace x with the disk where you want a backup of the selected volume).

Step 7: Enter the retain command, and you will be able to create mirrored system volume successfully.

diskpart mirrored

6. Create UEFI System Volume

UEFI (Unified Extensible Firmware Interface) system volume holds your system initialization and startup information. You can create UEFI system volume using diskpart by following the commands below:

Step 2: Type  diskpart in CMD and press enter.

Step 3: Enter the list disk command and select disk x  to select the disk.

Step 4: Convert your selected disk to GPT using the convert gpt  command.

Step 5: Now create the UEFI system partition using create partition efi size=100  

That's it, entering this command will create a UEFI system volume on your selected disk.

creating uefi partition

#2. Diskpart Alternative Software Free Download - EaseUS Partition Master

Using diskpart creat partition commands, you can create partition volumes of any type. However, this method is not suited for beginners and people that have not interacted with command-line interfaces.

An alternate solution is to use EaseUS Partition Master Free  which is a reliable disk partition software that perfectly replaces Diskpart.

EaseUS Partition Master Free edition helps you convert your partitions, manage the partitions, and create new partitions. It is a GUI-based tool, which means you do not have to remember or enter any command.

Using simple clicks, you can easily create a partitioned volume of your choice. It is highly recommended because a user with any computer expertise can smoothly use this software.

Step to use EaseUS Partition Master

Step 1. Launch EaseUS Partition Master. On the main window, right-click on the unallocated space on your hard drive or external storage device and select "Create".

Step 2. Adjust the partition size, file system (Choose the file system based on your need), label, etc. for the new partition and click "OK" to continue.

Step 3. Click on the "Execute 1 Task(s)" button and create a new partition by clicking "Apply".

Watch the following video tutorial and learn how to create a partition in NTFS, FAT, or EXT file system.

There are various types of partitions in the Windows computer system. Such as boot volume, system volume, dynamic volume, RAID-5 volume, mirrored system volume, and UEFI system volume.

Diskpart create partition command helps you to create these partitions in Windows. The diskpart utility is built-in, and you can access it through CMD without needing any software installation.

Unfortunately, entering commands to create partitions is not everyone's cup of tea. There is another easy way to create partitions in the Windows operating system for people who struggle with commands.

The alternate method is to use EaseUS Partition Master Free edition software. It does everything that the diskpart command does, but with just a few clicks.

FAQs about Creating Partitions Using Diskpart

Aside from the above tutorials, some of you may also have questions about creating other types of partitions by using Diskpart. Check the questions here, and hope you find desired answers ans solutions here.

1. How do I crate a GPT Partition Using Diskpart?

  • Press Windows + R keys, type cmd in Run dialog and hit enter.
  • Type  diskpart  and hit Enter.
  • Type  list disk  and hit Enter. Comfirm if your target disk is GPT or not.

If yes, continue with the steps here:

  • Type  select disk *  and hit Enter.
  • Type  create partition primary =*  and hit Enter.
  • Then type  assign letter=*  and hit Enter.
  • Type  format fs=NTFS quick  and hit Enter.

If not, back up all data to another drive, then continue with steps here:

  • Type  select disk * and hit Enter.
  • Type  clean  in diskpart and hit Enter.
  • Type convert GPT  and hit Enter. 

2. How do I create a MBR partition using Diskpart?

  • Open Diskpart and type  list disk  to confirm if your target disk is MBR or not.

If yes, follow the steps below:

If not, back up all valauble data to another drive, then follow the steps here:

  • Type  select disk *  and hit Enter. 
  • Type  clean  in Diskpart and hit Enter.
  • Type  convert mbr  and hit Enter.

3. How to create multiple partitions usign Diskpart

  • Press Windows + R keys and type  diskpart  in Run dialog, and hit Enter.
  • Type  list disk  and hit Enter.
  • Type select disk *  and hit Enter.
  • Type  create partition primary size=*  and hit Enter.
  • Type  assign letter=*  and hit Enter.
  • Type format fs=NTFS quick and hit Enter.
  • Type select disk * and hit Enter
  • Type create partition primary size=* and hit Enter.
  • Type assign letter=** and hit Enter.
  • Type format fs=NTFS quick and hit Enter. 

Repeat the process until you create multiple partitions on the target disk. Note that the MBR disk only alows creating up to 4 primary partitions. If you want more than 4 primary partitions on the disk, you'll need to convert the MBR disk to GPT first. 

Was This Page Helpful?

diskpart set filesystem type

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

Read full bio

Related Articles

How to Play Xbox 360 Games From an External Hard Drive

author icon

How to Delete OEM Partition in Windows 11/10/8/7 [2023 Updated]

author icon

How to Fix Cannot Convert GPT to MBR [2023 New]

author icon

How to Format My 1TB Hard Drive to FAT32? 2023 Guide for Beginners

diskpart set filesystem type

Copyright ©   EaseUS. All rights reserved.

diskpart set filesystem type

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

Is it possible to reset the filesystem on a partition/volume to NTFS without formatting?

I'm migrating the data on an old laptop to a new laptop. To accomplish this, I removed the disk from the old laptop and put it into a USB-SATA bridge. The first time, this worked fine, and I pretty much got all my files off the disk.

Then, I started installing apps on my new laptop, and one of the apps for a web service asked for my password, which I couldn't remember. I thought, okay, I can just eject the old laptop disk and put it back in my old laptop, boot it up, start the app, reset my password to something I remember.

So, I did an eject. I was told it was safe to remove the disk, so I did. Then, I put the old disk back in the old laptop and turned the old laptop on. I received a kind of pre-boot blue screen saying the NTFS was corrupted and would I like to repair. But, all the repairs it did could not bring the old disk back to booting in the old laptop.

Eventually, I started a command line in Recovery mode, launched diskpart and looked at the partitions and volumes on the old disk. And, my old laptop Windows drive now indicated an unknown filesystem.

I shut down the old laptop, and put the disk back in the SATA-USB bridge. Now, it turns out this partition is also Bitlocker encrypted, but I have the decryption key and it WORKS! If I enter the wrong key, like a digit transposed, it won't unlock the partition, but with the right number Bitlocker lets me open the disk. It just can't understand the filesystem on the volume anymore.

While the old disk was in the SATA-USB bridge, I took a look at it with Paragon Hard Disk Manager 15 and diskpart. I'm attaching those pictures here. It really looks like my disk is still intact, it's just "forgotten" that it is NTFS. Note that HDM reports an amount of free space that actually is pretty close to the free space I recall actually on the disk.

I don't know how the disk got into this state. Maybe there was a piece of fuzz when plugged old disk back into the old laptop. Is it possible something like safe boot, or - I don't know - Absolute Software Lojack has detected something fishy was going on because this old disk was moved out of old laptop?

So, my question boils down to whether there is a way through the command line, or the Powershell Command Line, to reset this disk/volume/partition to having NTFS as it's filesystem instead of unknown.

diskpart set filesystem type

Report abuse

Replies (1) .

1 person found this reply helpful

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
  • Ελληνικά
  • Русский
  • עברית
  • العربية
  • ไทย
  • 한국어
  • 中文(简体)
  • 中文(繁體)
  • 日本語

IMAGES

  1. DiskPart Command Simplified With Examples

    diskpart set filesystem type

  2. Diskpart List Disk

    diskpart set filesystem type

  3. List of DISKPART commands and How to use them in Windows 11/10

    diskpart set filesystem type

  4. How to Use DiskPart Utility in Windows

    diskpart set filesystem type

  5. How To Create Partition with DiskPart CMD [2023]

    diskpart set filesystem type

  6. DiskPart Command Simplified With Examples

    diskpart set filesystem type

VIDEO

  1. 62- File Server (Disk Management) Disk Defragment

  2. How To Format A Drive With Diskpart!

  3. std::filesystem::file_time_type from time_t

  4. How to partition a hard disk in windows without losing data

  5. Format Only C drive

  6. How to complete format disk and delete partition

COMMENTS

  1. set id

    To set the type field to 0x07 and force the file system to dismount, type: set id=0x07 override To set the type field to be a basic data partition, type: set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 Command-Line Syntax Key Feedback Submit and view feedback for

  2. How to Change Partition Type ID Easily? (2 Ways Included)

    - Solution 1: change partition type ID with a powerful utility - Solution 2: set partition type ID via Diskpart Conclusion About partition type ID Most computer users may be familiar with partitions and partition types.

  3. How to change GPT partition type on windows?

    To set a partition type in diskpart, one use : DISKPART> create partition msr or DISKPART> create partition efi or DISKPART> create partition primary But how to do change the type after partition creation like changing primary to efi ? windows uefi gpt diskpart Share Improve this question Follow edited Jan 8, 2016 at 22:47

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

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

    How to use DISKPART commands in Windows 11/10 Download Windows Speedup Tool to fix errors and make PC run faster Windows comes with a built tool— Disk Management —that offers a complete solution...

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

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

    Displays information about the selected disk, partition, volume, or virtual hard disk (VHD). Exits the diskpart command interpreter. Expands a virtual hard disk (VHD) to the size that you specify. Extends the volume or partition with focus, along with its file system, into free (unallocated) space on a disk.

  8. [Easy to Go] How to Change Partition Type (Partition ID) in ...

    You can learn how to change a partition type or how to change a partition id in Windows 10/8/7 computer and laptop using the DiskPart command. To change a partition type between MBR and GPT without making an effort, EaseUS Partition Master is your top choice. Free Download Windows 11/10/8/7 100% Secure Updated by Daisy on Dec 04, 2023

  9. How to Use DiskPart Utility in Windows

    To open Diskpart in Windows, right-click your Windows Start menu button and click Windows PowerShell (Admin). In your admin-level PowerShell terminal (or similar Windows command line), type diskpart and hit enter. The Diskpart tool will launch within the window, ready for you to use. Type exit at the "DISKPART>" prompt and hit enter once ...

  10. DiskPart

    Use the select partition command to select a partition and shift the focus to it. ADD disk= n [align= n] [wait] [ noerr ] Mirror the simple volume with focus to the specified disk. ASSIGN [ {LETTER= D | mount= path }] [ noerr ] Assign a drive letter or mount point to the volume with focus.

  11. Use Diskpart to Change Partition Type |Yes or No?

    Step 1: Download free demo, install and launch AOMEI Partition Assistant. Step 2: All partitions' statue will be displayed on the main interface, including partition type. Right click the one you're going to change. Select Advanced → Convert to Logic Partition. Step 3: In the pop-up window, click OK.

  12. UEFI/GPT-based hard drive partitions

    Click Start, right-click This PC, and then click Manage. The Computer Management window opens. Click Disk Management. The list of available drives and partitions appears. In the list of drives and partitions, confirm that the system and utility partitions are present and are not assigned a drive letter.

  13. Using Diskpart to create, delete, clean or extend disk partitions

    This operation deletes all data on the disk by writing zeros on each disk sector. Diskpart also removes all partition and volume information from the selected drive. To clean a disk: At a command prompt, type diskpart. At the DISKPART prompt, type select disk 0. At the DISKPART prompt, type clean all.

  14. Change File System between NTFS and FAT32 without Formatting

    Free Partition Software > Change File System between NTFS and FAT32 without Formatting Change File System between NTFS and FAT32 without Formatting Want to convert between NTFS and FAT32 without losing data? Learn to change file system on HDD, external hard drive, USB flash drive, or Pen Drive without formatting in Windows.

  15. How do I change system partition to primary over DISKPART?

    Select the drive then click New. NOTE: If you have multiple partitions listed, select each one (starting at the bottom), then click delete until there is only a single (one) unallocated drive displayed in the window. Select the unallocated drive listed, click New, click Apply then OK.

  16. Create disk partitions in Windows using diskpart command

    2. Now type diskpart on the command prompt. If you're running Windows server, you can just run Powershell then launch diskpart on the cli. diskpart. 3. List available disk drives using the command below: list disk. 4. Now select the drive you want to partition using select disk command.

  17. diskpart scripts and examples

    Examples. To run a diskpart script, at the command prompt, type the following command, where scriptname is the name of the text file that contains your script: diskpart /s scriptname.txt. To redirect diskpart's scripting output to a file, type the following command, where logfile is the name of the text file where diskpart writes its output ...

  18. Factory recovery

    1 - DISKPART> select disk 0. 2 - DISKPART> list partition. 3 - DISKPART> select partition 1 (Now, select the recovery partition) [4 is Optional for don't remember recovery part] 4 - DISKPART> detail partition (verify that it is recovery. Remember the Type value, this will be handy if something goes wrong)

  19. How to Create Volume/Partition Using Diskpart? [Full Guide]

    Adjust the partition size, file system (Choose the file system based on your need), label, etc. for the new partition and click "OK" to continue. Step 3. Click on the "Execute 1 Task(s)" button and create a new partition by clicking "Apply". Watch the following video tutorial and learn how to create a partition in NTFS, FAT, or EXT file system.

  20. Is it possible to reset the filesystem on a partition/volume to NTFS

    RM RMDEQ Created on October 25, 2019 Is it possible to reset the filesystem on a partition/volume to NTFS without formatting? I'm migrating the data on an old laptop to a new laptop. To accomplish this, I removed the disk from the old laptop and put it into a USB-SATA bridge.