6 Ways to Use Disk Management Commands like a Pro

July 3, 2017

Disk Management is a built-in tool for managing disks and partitions. Besides this GUI tool, you can also use disk management commands from command prompt to perform disk-related tasks.

Open Disk Management from command prompt

In Windows 10/8/7, there is a very useful built-in tool for managing disk and volume related tasks. Some users may not know of this tool because it is buried deep down in Windows. Luckily, you can open Disk Management from command prompt in all versions of Windows and it is really quick.

Press Windows + R key to bring out the Run window. From there, type in “diskmgmt.msc” and press Enter.

Open Disk Management from Command

Then you will see Disk Management with all the disks and partitions listed. If you right click on a partition or disk, it will bring out many available options. You can shrink volume, extend volume, delete volume, convert to GPT/MBR, convert to dynamic disk, etc.

Some of the options may be grayed out due to various reasons. For example, Disk Management will not allow you to delete recovery partition, but you can delete recovery partition from command prompt. For managing disk partitions, you can do more with Windows built-in command utility DiskPart.exe.

Delete partition using disk management command

In case you may accidentally delete some crucial partitions, some partitions (for example recovery partition) cannot be deleted in Disk Management. When you right click on it in Disk Management, you will see the option Delete Volume is greyed out.

Some computer manufacturer has made a factory recovery partition on the hard drive that allows you to restore computer to factory default settings. It may also be called OEM partition. Microsoft has mentioned that the factory recovery partition will not be available after upgrading to Windows 10.

If you need to delete the OEM partition to free up a few gigabytes of space, then you can use Diskpart commands.

1. Type “diskpart.exe” in the Run box and press Enter to open DiskPart command window.

2. Type “list disk”

3. Type “select disk [disk number]”

4. Type “list partition”

5. Type “select partition [partition number]”

6. Type”delete”

Delete Partition from Command Line

When the operation complete successfully, you can exit DiskPart.

Extend partition or create new partition

If you delete a partition or shrink a partition, it will generate some unallocated space. To make use of the unallocated space, you can either add it to the contiguous partition or create a new partition.

To extend partition from command line, open Diskpart window and type the following:

List disk

Select disk [disk number]

List partition

Select partition [partition number]

Extend size=n (if you do not specify the extend size, all unallocated space will be added to the contiguous partition)

Extend Volume Diskpart

To create a new partition from command prompt, type the following:

List disk

Select disk [number]

create partition primary [size=n] or create partition logical [size=n]

assign letter=H (you can assign any unused drive letter to the new partition)

If your hard drive was initialized as MBR partition style, then it can only have 4 primary partitions or 3 primary partitions plus many logical partitions. Therefore, if your hard drive already has 3 primary partitions and you need more partitions, then you can create a logical partition.

Convert to GPT or MBR from command prompt

GPT partition style is more advanced than MBR. If you want to break the 2TB hard drive limit, you can convert MBR to GPT. As you may know, GPT and MBR disks use different boot mode. If you want to boot from MBR disk, you need to make sure BIOS based Legacy mode is enabled. If you want to install Windows 10/8/7 on GPT disk, you need to enable UEFI boot mode.

If you do not configure it right, Windows will fail to boot. If you receive the error “Windows cannot be installed on this disk. The selected disk is of GPT partition style”, then you need to either change Legacy to UEFI or convert the disk to MBR disk.

To convert GPT/MBR during Windows installation:

1. Press Windows and F10 key simultaneously to open a command prompt.

2. Type”diskpart”

3. Type”list disk”

4. Type “select disk [disk number]”

5. Type “clean”

6. Type “convert mbr”

Convert to MBR with Diskpart

This operation will clear all the data on the drive. If there is valuable data on it, you should create a backup before applying this. If you want to convert MBR to GPT disk, you just need to change the last command to “convert gpt”.

Convert FAT32 to NTFS files system from command prompt

Fat 32 is the most compatible file system, so most of the USB is formatted with FAT32 by default. When you try to move a file that is larger than 4 GB, you will receive an error “the file is too large for the destination file system”. In that case, you can convert FAT32 to NTFS without data loss.

You can type “cmd” in a Run box and press Enter to open a command line window.

In the command prompt window, type: convert [drive letter:] /fs:ntfs

Convert to NTFS Command

After converting to NTFS, you cannot convert back to NTFS unless you try third party tools.

Disk management software

If you need to more advanced features regarding disk and partition management, you can use AOMEI Partition Assistant. It is available both in GUI and command prompt. It provides more features than Windows built-in disk management tools. For example, you can use it to convert disk to MBR/GPT without data loss, convert dynamic to basic without affecting OS.

It is very easy to use, just like Disk Management. You can just right-click on a partition or disk and all the available operations will be listed. It provides 8 wizards to guide you every step of the way. It also allows you to preview the partition layout before you actually apply any changes to your hard drive. You can see the interface below:

Disk Management Software

As mentioned, it also allows you to partition hard drive from command prompt.

PA Extend Partition

As you probably know that Windows built-in disk management commands have some limitations. For example, you can only extend volume when there is contiguous unallocated space, and converting to GPT/MBR will wipe out all data on the disk. Therefore, to perform advanced operations on disk partitions, you can use AOMEI Partition Assistant.