How To Use Diskpart In Windows 10 Using Cmd - FreeCodeBlog

Last updated: Nov 07, 2021

You can check list of disk, disk partition, disk volume in windows 10 using command prompt (cmd). Also you can create new partition, delete old partition using diskpart.

 

Well, Let's see what can you do using diskpart in windows 10 cmd:

 

  • Join DiskPart.
  • Disk List Checking.
  • Disk Format Checking.
  • Partition List Checking.
  • Partition Type Checking.
  • Selected Partition Checking.
  • Delete Primary Partition.
  • Delete Logical Partition.
  • Delete Extended Partition.
  • Create Primary Partition.
  • Volume List Checking.
  • Selected Volume Checking.
  • Remove Drive Letter.
  • Disk Clean.
  • MBR to GPT.
  • GPT to MBR.
  • Exit DiskPart

 

Join DiskPart:

First you need to open cmd as a adminstration to checking join diskpart. After opening cmd you need to command diskpart.

 

diskpart

 

Disk List Checking:

After join diskpart you need to run command list disk to see your hard disk list.

 

list disk

 

Disk Format Checking:

After successfully run list disk command you will see gpt column in your disk line (like disk 0, disk 1). If you see star (*) in your disk line gpt column then your hard disk format is GPT and If you can't see star (*) in your disk line gpt column then your hard disk format is MBR.

 

Partition List Checking:

First you need to run sel disk 0 (choose your disk) to checking disk partition list after successfully run list disk command.

 

sel disk 0

 

Now run list partition to see all partition of disk 0.

 

list partition

 

Partition Type Checking:

Before creating or deleting partition you need to know about disk partition type. There are three types of partitions (Primary, Extended, Logical).

 

Selected Partition Checking:

After selected a disk you can check partition list. If you see a star (*) left of primary column line then that line is selected partition. If you can't see a star (*) then command the selected partition command to select a partition.

 

select partition 1

 

Delete Primary Partition:

You need to run select partition 1 (choose your primary partition number) to delete partition 1 after running list partition command.

 

select partition 1

 

Now run delete partition command to delete partition 1.

 

delete partition

 

If you select a primary partition to delete then delete partition command will be working properly.

 

Delete Logical Partition:

You need to run select partition 1 (choose your logical partition number) to delete partition 1 after running list partition command.

 

select partition 1

 

Now run delete partition command to delete partition 1.

 

delete partition

 

If you select a logical partition to delete then delete partition command will be working properly.

 

Delete Extended Partition:

You need to run select partition 1 (choose your extended partition number) to delete partition 1 after running list partition command.

 

select partition 1

 

Now run delete partition command to delete partition 1.

 

delete partition

 

If you have any logical partition then you can't delete extended partition. To deleting extended partition first you need to delete all logical partitions. After delete all logical partition delete partition command will working properly.

 

Create Primary Partition: 

You can create new partition in your disk using windows 10 CMD.

 

Before create a new partition you need to check your disk unlocated space using below command.

 

list disk

 

If you see free space in your disk then you can create new partition.

 

Ensure that you selected a disk to create new partition.

 

sel disk 0 (choose your disk)

 

To create a new primary partition using cmd.

 

create partition primary size=your-unlocated-space

 

To setup partition ntfs format.

 

format fs=ntfs quick

 

To assign letter in partition.

 

assign letter N:

 

Assign letter that not assigned into others partition.

 

Volume List Checking:

If you already run sel disk 0 (choose your disk number) then run list vol command to checking disk volume.

 

list vol

 

Selected Volume Checking:

After selected a disk you can check volume list. If you see a star (*) left of volume column line then that line is selected volume. If you can't see a star (*) then command the selected volume command to select a volume.

 

sel vol 0

 

Remove Drive Letter:

For example you want to remove D drive letter.

 

To remove D drive letter first you need to select D drive volume that filled ltr column with D letter.

 

Suppose your D drive volume is volume 2.

 

Now run this below command to select volume 2

 

sel vol 2

 

After selected volume 2 you can remove D letter from volume 2.

 

remove letter=D:

 

Disk Clean:

Before run clean command ensure that you selected a disk.

 

Warning: clean command will be delete all partition, volume, data. So make sure you backup your all importance data from disk.

 

clean

 

MBR to GPT:

After run clean command run this below command to convert your disk type MBR to GPT.

 

Warning: this command will be delete all data from your selected disk.

 

convert gpt

 

GPT to MBR:

If you have already gpt type disk and you want to convert your gpt disk to mbr disk then run the below command.

 

Warning: this command also delete your all partition, data, volume.

 

clean

 

Exit DiskPart:

To exit DiskPart you need to run the below command.

 

exit

 

Thanks.

Post Tags
Post Writer
masum7323
Masum Biswas (@masum7323)

My name is Masum Biswas. I'm a full stack developer. I live in Bangladesh and I love to write tutorials and tools that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, MySQL, VueJS, Tailwind CSS and Bootstrap from the early stage.

Follow Me On
Related Posts
How To Fix Corrupted Files And System Errors Using Windows 10 Command Prompt

You need to open command prompt as a adminstration to fix corrupted files and system errors in windows 10. After opening cmd you need to run the be... Read More

How To Install Windows 10 Using Bootable Pendrive In Laptop Or Desktop

Install windows 10 using bootable pendrive in laptop or desktop. To install windows 10 you need to make a bootable pendrive using minimun 8GB pendr... Read More

How To Install Putty On Window 10

PuTTY is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. PuTTY is open source software that is available w... Read More

How To Install Git Bash On Devices

You have to install git bash on your devices like windows, mac, linux. I will explain you how you can install git bash on any devices. so let's sta... Read More

Identify Efi Or Boot Partition In Windows 10

Identify EFI or boot partition in windows 10. Open windows 10 cmd as a adminstration to checking EFI or boot partition. After opening cmd as admins... Read More