Windows Diskpart Command Tutorial with Examples To Format Disk

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/windows-diskpart-command-tutorial-examples-format-disk/
PINTEREST
PINTEREST
INSTAGRAM

diskpart is a Windows utility to create partitions on disk. It is similar to the Linux fdisk utility. diskpart provides interactive command shell where we will enter related commands to partition, format disk and volumes. In order to run diskpart we need Administrator privileges. Best way to get Administrator privilege is opening MS-DOS as Administrator by right clicking on it.

Interactive Mode

diskpart is mainly used by its interactive shell. So we should enter this shell with the diskpart command. All commands issued bellow are used in interactive diskpart shell.

Interactive Mode
Interactive Mode

Help

There are a lot of command supported by diskpart . We can list these commands with help

Help
Help

List Disk and Partitions

First we need to know how many disk there are. We will use list disk command for this. We will also get following information about disks.

  • Status
  • Size
  • Free
  • Gpt

List Disk and Partitions
List Disk and Partitions

Select Disk

Now we will select second disk which is numbered as 1. Because disk numbers start from 0 . We will use select disk 1 . In order to execute format commands we should select a disk.

Select Disk
Select Disk

Clean Drive

If there is an already set configuration we should clear them to make things simple.  We will use clean command.

Clean Drive
Clean Drive

Check Disk Selection

In order to execute commands to format disk we should select the disk and partition. We have already selected disk but we can check this selection with list disk command too. Selected disk will have asterisk before its name.

LEARN MORE  Ffmpeg Command Tutorial With Examples For Video and Audio

Check Disk Selection
Check Disk Selection

Create Partition

We will create a partition on selected disk. We will issue create partition primary . There are primary and secondary partition type. IF we have less than 5 partition in a disk we can use primary for all of them.

Create Partition
Create Partition

List Partition

Now we can list partition we have already created. We will use list partition command for this. Also following information about partition will be listed

  • Partition name
  • Partition Type
  • Szie
  • Offset

List Partition
List Partition

Select Partition

In order to operate on the given partition we should select the partition with the select partition command. This will select selected disks given partition according to number.

Select Partition
Select Partition

Activate Partition

In order to use partition we will activate it. We will use active command.

Activate Partition
Activate Partition

Format Partition

This is the one of the most important part. We will format the selected and activated partition. We Will use format command. Also we will specify the file system type with FS option. label option is used to set the name of partition which is shown to user. quick specifies the format operation speed. In this example we set file system type NTFS and label D

Format Partition
Format Partition

Assign Letter

In order to use the partition we should assign a letter to the formatted partition. We will use assign command with letter option. In this example we assign letter E to the partition.

LEARN MORE  Windows Performance Recorder (wpr) Command Tutorial with Examples To Record Performance Metrics

Assign Letter
Assign Letter

We can see from screenshot that we have tried to assign D previously which is already assigned. This produced error and operation is not completed.

Exit

We can exit from the diskpart interactive shell with exit command like below.

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/windows-diskpart-command-tutorial-examples-format-disk/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.