• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
WebSetNet

WebSetNet

Technology News

  • Technology News
    • Mobile
    • Games
  • Internet Marketing
  • System Admin
    • Windows
    • Linux
    • Mac & Apple
    • Website Scripts
      • Wordpress

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

August 15, 2021 by billy16

Windows comes with a built tool— Disk Management —that offers a complete solution to manage hard disks on the computer. You can use it to shrink volume, increase volume or portion size, create new ones, and so on. The user interface is built using a set of commands— DISKPART — that works on PowerShell or Command Prompt. It comes in handy when you need to run complex commands and work with the virtual hard disk. Diskpart utility has a list of commands that one can use that are shared in the post.

List of Diskpart Commands

List of Diskpart Commands in Windows 11/10

active Marks the disk’s partition with focus as active.
add Mirrors the simple volume with focus to the specified disk.
assign Assigns a drive letter or mount point to the volume with focus.
attach vdisk Attaches (sometimes called mounts or surfaces) a virtual hard disk (VHD) so that it appears on the host computer as a local hard disk drive.
attributes Displays or sets or clears the attributes of a disk or volume.
automount Enables or disables the automount feature.
break Breaks the mirrored volume with focus into two simple volumes.
clean Removes any and all partition or volume formatting from the disk with focus.
compact vdisk Reduces the physical size of a dynamically expanding virtual hard disk (VHD) file.
convert Converts file allocation table (FAT) and FAT32 volumes to the NTFS file system, leaving existing files and directories intact.
create Creates a partition on a disk, a volume on one or more disks, or a virtual hard disk (VHD).
delete Deletes a partition or a volume.
detach vdisk Stops the selected virtual hard disk (VHD) from appearing as a local hard disk drive on the host computer.
detail Displays information about the selected disk, partition, volume, or virtual hard disk (VHD).
exit Exits the diskpart command interpreter.
expand vdisk Expands a virtual hard disk (VHD) to the size that you specify.
extend Extends the volume or partition with focus, along with its file system, into free (unallocated) space on a disk.
filesystems Displays information about the current file system of the volume with focus and lists the file systems that are supported for formatting the volume.
format Formats a disk to accept Windows files.
gpt Assigns the gpt attribute(s) to the partition with focus on basic GUID partition table (gpt) disks.
help Displays a list of the available commands or detailed help information on a specified command.
import Imports a foreign disk group into the disk group of the local computer.
inactive Marks the system partition or boot partition with focus as inactive on basic master boot record (MBR) disks.
list Displays a list of disks, of partitions in a disk, of volumes in a disk, or of virtual hard disks (VHDs).
merge vdisk Merges a differencing virtual hard disk (VHD) with its corresponding parent VHD.
offline Takes an online disk or volume to the offline state.
online Takes an offline disk or volume to the online state.
recover Refreshes the state of all disks in a disk group, attempts to recover disks in an invalid disk group, and resynchronizes mirrored volumes and RAID-5 volumes that have stale data.
rem Provides a way to add comments to a script.
remove Removes a drive letter or mount point from a volume.
repair Repairs the RAID-5 volume with focus by replacing the failed disk region with the specified dynamic disk.
rescan Locates new disks that may have been added to the computer.
retain Prepares an existing dynamic simple volume to be used as a boot or system volume.
san Displays or sets the storage area network (san) policy for the operating system.
select Shifts the focus to a disk, partition, volume, or virtual hard disk (VHD).
set id Changes the partition type field for the partition with focus.
shrink Reduces the size of the selected volume by the amount you specify.
uniqueid Displays or sets the GUID partition table (GPT) identifier or master boot record (MBR) signature for the disk with focus.

TIP: You can resize a Partition even if Disk Management fails using DISKPART and FSUTIL command-line tools for Disk Management.

How to use Diskpart?

Diskpart Commands

Diskpart runs in its own space, so when you run the command, you will not be able to use the regular commands but only the Diskpart commands.

  • Type CMD in the Start screen, and choose to Run as Administrator
  • Type Diskpart, and press the Enter key.
  • You should see the console to switch from regular Windows path to Diskpart
  • Post this; you can start with few basic commands to understand how it works.

Note: Be aware if you choose to delete anything, it cannot be recovered.

Few Basic Commands to Start With Diskpart

  • List Disk: Displays number of connected hard drives or storage
  • Select Disk <no> : Selects the particular disk
  • List Partition: Displays list of partitions for the selected disk
  • List Volume: Displays all the partitions of all the disks

How to open DiskPart in Windows?

Open Command Prompt with admin privileges, type Diskpart, and press the Enter key. You can also launch Diskaprt using the Run prompt. Make sure to press Shift + Enter to launch it with admin privileges.

How Do I List Drives in Diskpart?

Once you are inside Diskpart, type List Disk, this will list down all the connected storage, including hard drives, USB storage, SD card, or anything else connected to the PC.

How Do I Delete a Volume or Partition?

  • Select Disk <no>
  • List Volume
  • Select Volume <no>
  • Delete Volume

Post this; a confirmation message will show up that Diskpart has successfully deleted the volume. That said, you cannot delete System or Boot Volume. If you are unable to delete it, make sure to read this guide.

How Do I Assign Drive Letter to a Hidden Partition?

If a partition can be seen in the Diskpart tool but is not available through the File Explorer, then it’s because there is no drive letter assigned to it.

  • Select Disk <no>
  • List Volume
  • Select Volume <no>
  • assign letter=<alphabet>

Make sure that the assigned alphabet is not already in use.

How to Reduce the Size of a partition?

Before we move ahead, be aware that this is a very long process. Until the process is complete, the drive will be almost useless.

  • Select Disk <no>
  • List Volume
  • shrink desired=<no>

This works for the NTFS file system only.

How to Erase a Disk using Diskpart Clean Command?

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

Make sure not to use the clean all command; it will remove all partitions of the selected disk. Also, it will take an hour or so, depending on the disk size, as it will perform a secure erase.

Free Alternatives to Windows Diskpart Utility

These are third-party software that offers a better interface and features compared to Diskpart. In fact, you get to see a preview of the change before the change is committed. Here is a quick list:

  • Paragon Partition Manager Free Edition
  • Macrorit Disk Partition Expert
  • More Disk & Partition Manager software for Windows

I hope you were able to understand how to use it, the list of commands Diskpart houses, and alternatives to Windows Diskpart software that you can use for a better experience.

Original Article

Related posts:

  1. A comparison of GPT and MBR partition structures
  2. How To Partition USB Drives In Windows 10 Using Disk Management
  3. How to mirror Boot Hard Drive for UEFI on Windows 10
  4. Migrate Windows 10 To Solid State Drive (SSD), Using The EaseUS Partition Master
  5. Running out of storage? Try these tips to free up space on Windows 10
  6. The ultimate guide to fixing problems with the May 2020 Update
  7. Essential command tools to fix virtually any networking issue on Windows 10
  8. Fast Delete Complex Directories
  9. Amazon Alexa Easter eggs: Over 180 funny things to ask Alexa
  10. Amazon Alexa Easter eggs: Over 180 funny things to ask Alexa

Filed Under: Windows

Primary Sidebar

Trending

  • How to fix Windows Update Error 80244019
  • Windows 10 Update keeps failing with error 0x8007001f – 0x20006
  • How To Change Netflix Download Location In Windows 10
  • Troubleshoot Outlook “Not implemented” Unable to Send Email Error
  • How do I enable or disable Alt Gr key on Windows 10 keyboard
  • How To Install Android App APK on Samsung Tizen OS Device
  • 3 Ways To Open PST File Without Office Outlook In Windows 10
  • FIX: Windows Update error 0x800f0986
  • How to Retrieve Deleted Messages on Snapchat
  • Latest Samsung Galaxy Note 20 leak is a spec dump revealing key features
  • Install Android 7.0 Nougat ROM on Galaxy Core 2 SM-G355H
  • 192.168.1.1 Login, Admin Page, Username, Password | Wireless Router Settings
  • Websites to Watch Movies Online – 10+ Best Websites Without SignUp/Downloading
  • How to Backup SMS Messages on Your Android Smartphone
  • How to delete a blank page at the end of a Microsoft Word document
  • Fix: The Disc Image File Is Corrupted Error In Windows 10
  • Android 11 Custom ROM List – Unofficially Update Your Android Phone!
  • Samsung Galaxy Z Fold 3 could be scheduled for June 2021, with S Pen support

Footer

Tags

Amazon amazon prime amazon prime video Apple Application software epic games Galaxy Note 20 Galaxy S22 Plus Galaxy S22 Ultra Google Sheets headphones Huawei icloud Instagram instant gaming ip address iPhone iphone 12 iphone 13 iphone 13 pro max macOS Microsoft Microsoft Edge Mobile app office 365 outlook Pixel 6 Samsung Galaxy Samsung Galaxy Book 2 Pro 360 Samsung Galaxy Tab S8 Smartphone speedtest speed test teams tiktok Twitter vpn WhatsApp whatsapp web Windows 10 Windows 11 Changes Windows 11 Release Windows 11 Update Windows Subsystem For Android Windows 11 Xiaomi

Archives

  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org