Free tools Windows power users keep installed
One-click scans. No signup required.
Diskpart is a powerful command-line tool built into Windows for managing disks, partitions, and volumes. It can help you view storage devices, create or delete partitions, format drives, assign drive letters, and prepare disks for use when the graphical Disk Management tool is not enough.
Because Diskpart works directly with your storage devices, a single wrong command can erase data or modify the wrong drive. Beginners should use it carefully, double-check disk numbers and volume labels, and back up anything before running commands that clean, delete, or format a disk.
As an Amazon Associate I earn from qualifying purchases.
This guide introduces Diskpart in a practical, beginner-friendly way, with clear examples for opening the tool safely and using essential commands to inspect, select, clean, partition, format, and manage drives in Windows.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →What Is Diskpart in Windows?
Diskpart is a built-in Windows command-line tool used to manage disks, partitions, and volumes. It is included with modern versions of Windows, including Windows 10, Windows 11, and Windows Server, and it can perform many of the same storage tasks available in the graphical Disk Management tool. Instead of clicking through menus, you type commands such as list disk, select disk, create partition primary, and format to inspect and change storage devices.
#1 Best Overall
- Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
Beginners usually encounter Diskpart when fixing a USB drive, preparing a new SSD, removing stubborn partitions, assigning a missing drive letter, or cleaning a disk before reinstalling Windows. It works with internal hard drives, SSDs, USB flash drives, external drives, SD cards, and virtual disks. Because Diskpart communicates directly with Windows storage management, it can see devices that may not appear correctly in File Explorer, especially when a drive has no usable partition, no drive letter, or an unsupported file system.
What Diskpart can do
Diskpart is powerful because it can handle low-level storage tasks. Common uses include checking which disks are connected, selecting a specific disk or volume, wiping partition information, creating new partitions, formatting volumes as NTFS, FAT32, or exFAT, and assigning drive letters. For example, if a USB drive appears in Disk Management but not in File Explorer, Diskpart may be used to select the volume and assign it a drive letter. If a new SSD shows as unallocated, Diskpart can initialize the process of creating and formatting a partition so Windows can store files on it.
- View storage devices: Display disks, volumes, and partitions connected to the computer.
- Select a target: Choose the exact disk, partition, or volume before making changes.
- Clean a disk: Remove partition and formatting information from a selected drive.
- Create partitions: Prepare unallocated space for use by Windows.
- Format volumes: Apply a file system so the partition can store data.
- Assign letters: Make a volume accessible in File Explorer.
Diskpart should be used carefully because many of its commands make immediate changes. A command such as clean can remove the partition structure from the selected disk, making existing files inaccessible without recovery tools. Formatting the wrong volume can erase data, and selecting the wrong disk can affect your Windows installation or another drive. Diskpart does not rely on friendly visual cues the way Disk Management does, so confirming disk numbers, sizes, and labels before running destructive commands is part of using it safely.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →In simple terms, Diskpart is Windows’ text-based disk management utility. It is especially useful when graphical tools are unavailable, when storage devices need to be prepared quickly, or when troubleshooting requires more direct control. For beginners, the safest way to think about Diskpart is as a precision tool: first use commands that only display information, then select the correct target, and only then run commands that modify, erase, create, or format storage.
How to Open Diskpart Safely
Diskpart makes direct changes to disks, partitions, and volumes, so it should always be opened with care. Before launching it, save your work, close apps that are using external drives, and confirm that any files are backed up. A mistaken command such as clean can remove partition information from the selected disk, which may make data inaccessible. If you are practicing for the first time, use an empty USB flash drive rather than a drive that contains personal files or your Windows installation.
The safest way to open Diskpart is from an elevated Command Prompt or Windows Terminal. “Elevated” means it is running with administrator permissions, which Diskpart needs for most disk management operations. In Windows 11 or Windows 10, right-click the Start button and choose Terminal (Admin), Windows PowerShell (Admin), or Command Prompt (Admin), depending on what appears on your system. If Windows asks for permission through User Account Control, choose Yes.
- Right-click Start or press Windows + X.
- Select Terminal (Admin), Windows PowerShell (Admin), or Command Prompt (Admin).
- At the prompt, type diskpart and press Enter.
- Wait until the prompt changes to DISKPART>.
You can also open it from the Start menu. Click Start, type cmd, right-click Command Prompt, and select Run as administrator. Then type diskpart and press Enter. The same approach works if you search for Windows Terminal instead. Avoid opening Diskpart from a non-administrator window, because some commands may fail or return access errors.
Check the environment before running commands
Once Diskpart is open, do not jump straight into destructive commands. Start with read-only commands such as list disk, list volume, and list partition. These help you identify each drive by size, status, and number. Pay close attention to disk sizes: for example, a 32 GB USB drive and a 1 TB internal system drive should be easy to distinguish, but two similar external drives can be confusing. If possible, disconnect drives you do not need to manage before opening Diskpart.
Rank #2
- Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
- Verify the target disk by size: match the listed capacity with the physical drive you intend to manage.
- Look for the Windows drive: avoid the disk that contains your active Windows installation unless you know exactly what you are doing.
- Remove unnecessary external drives: fewer connected disks reduces the chance of selecting the wrong one.
- Use read-only commands first: listing disks and volumes is safe and helps confirm what Diskpart sees.
To leave Diskpart, type exit and press Enter. If you are unsure about a command, exit before making changes and review the disk layout in Disk Management by right-clicking Start and selecting Disk Management. This graphical view can make it easier to confirm drive letters, partition sizes, and labels before returning to Diskpart.
Essential Diskpart Commands for Beginners
Diskpart works by typing short commands into an interactive prompt. After you open Command Prompt or Windows Terminal as an administrator and enter diskpart, the prompt changes to DISKPART>. From there, every command you type can affect real disks, partitions, and volumes on your PC. For beginners, the safest approach is to start with read-only commands, confirm the disk number carefully, and only run destructive commands such as clean when you are certain you have selected the correct drive.
Basic viewing commands
The first commands to learn help you see what Windows detects. These are useful before making any change because Diskpart identifies drives by number, not by friendly names like “USB drive” or “Backup disk.” Use the size column, free space, and status to identify the correct target.
- list disk — Shows all physical disks connected to the computer, such as internal SSDs, hard drives, USB drives, and external storage.
- list volume — Shows volumes with drive letters, file systems, labels, sizes, and status.
- list partition — Shows partitions on the currently selected disk.
- detail disk — Displays more information about the selected disk, including volumes on that disk.
- detail volume — Displays details about the selected volume.
Selection commands
Most Diskpart actions require you to select a target first. Selection commands do not modify data by themselves, but they determine what the next command will affect. For example, if you select the wrong disk and then run clean, Diskpart will erase the partition information on that wrong disk.
- select disk 1 — Selects disk number 1. Replace 1 with the disk number shown by list disk.
- select volume 3 — Selects volume number 3 from the list volume output.
- select partition 2 — Selects partition number 2 on the currently selected disk.
Common management commands
After selecting the correct target, Diskpart can create partitions, format volumes, assign drive letters, and remove configuration data. Some commands are low risk, while others can cause immediate data loss. Always make sure backups exist before changing a disk that contains files you need.
| Command | What it does | Beginner example |
|---|---|---|
| clean | Removes partition and volume information from the selected disk. | Use before reusing or repartitioning a USB drive. |
| create partition primary | Creates a primary partition on the selected disk using available space. | Create a new partition after running clean. |
| format fs=ntfs quick | Quick-formats the selected partition as NTFS. | Prepare a Windows storage drive for large files. |
| format fs=exfat quick | Quick-formats the selected partition as exFAT. | Prepare a USB drive for Windows and macOS compatibility. |
| assign letter=E | Assigns a drive letter to the selected volume. | Make a newly formatted volume appear as drive E: in File Explorer. |
| remove letter=E | Removes a drive letter from the selected volume. | Hide a volume from File Explorer without deleting it. |
A typical beginner workflow for preparing an empty USB drive is: list disk, select disk 1, clean, create partition primary, format fs=exfat quick, and assign. The disk number in that example is only a placeholder; your USB drive may appear as a different number. If you are unsure, unplug the USB drive, run list disk, plug it back in, run list disk again, and compare the results before selecting anything.
To leave Diskpart, type exit and press Enter. If you are only exploring, use viewing commands and detail commands until you are comfortable reading the output. Treat any command that cleans, deletes, formats, converts, or creates partitions as a permanent change unless you have a verified backup.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallHow to View and Select Disks, Volumes, and Partitions
Before you run any command that changes storage, use Diskpart to identify the correct disk, volume, or partition. Diskpart works by selecting an object first, then applying later commands to that selected object. If you select the wrong disk and run a destructive command such as clean, you can erase the wrong drive. Spend a few extra moments checking disk size, drive letters, labels, and partition layout before making changes.
Rank #3
- Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
View all disks
At the DISKPART> prompt, type list disk to show the physical drives Windows can detect. This includes internal SSDs and hard drives, external USB drives, SD cards, and sometimes virtual disks. The output usually shows each disk number, status, size, free space, and whether it uses GPT. For example, your Windows system drive might appear as Disk 0 with a size of 476 GB, while a USB flash drive might appear as Disk 2 with a size of 29 GB.
- list disk — shows all detected physical disks.
- select disk 2 — selects Disk 2 as the active target.
- detail disk — displays more information about the selected disk, including volumes on it.
After identifying the disk, select it with select disk number. For example, use select disk 2 if the USB drive you want to manage is listed as Disk 2. Diskpart should respond with a message such as Disk 2 is now the selected disk. Then run detail disk to confirm you selected the intended device. Check the model name, type, size, and associated volumes before continuing.
View and select volumes
A volume is a usable storage area that often has a drive letter, such as C:, D:, or E:. To display volumes, type list volume. This view is useful when you know the drive letter or label but not the physical disk number. For instance, if File Explorer shows a removable drive as E: named BACKUP, list volume can help you find the matching volume number in Diskpart.
- list volume — shows volumes, drive letters, labels, file systems, sizes, and status.
- select volume 4 — selects Volume 4.
- select volume E — selects the volume with drive letter E, when available.
- detail volume — shows detailed information about the selected volume.
For example, if list volume shows that Volume 4 has drive letter E, file system exFAT, and size 29 GB, you can type select volume 4. If you prefer using the drive letter, select volume E may be easier to read. After selection, use detail volume to verify the file system, status, and related disk information.
View and select partitions
Partitions are sections on a selected physical disk. To see partitions, you must select a disk first. For example, type select disk 0, then list partition. This may show a small EFI System partition, a Microsoft Reserved partition, the main Windows partition, and a Recovery partition. On a USB drive, you may see only one primary partition.
| Goal | Command sequence |
|---|---|
| Check physical drives | list disk |
| Select a USB drive | select disk 2, then detail disk |
| Find a drive letter | list volume |
| View partitions on a disk | select disk 0, then list partition |
| Select a partition | select partition 3, then detail partition |
Use select partition number only after confirming you are on the correct disk. A command such as delete partition affects the selected partition immediately, so verify the selection with detail partition first. When in doubt, compare Diskpart results with Disk Management or File Explorer before making changes.
Common Diskpart Tasks: Clean, Create, Format, and Assign
Once you can identify and select the correct disk, volume, or partition, Diskpart becomes useful for common storage setup tasks. The commands in this section are often used when preparing a new drive, fixing a USB drive that will not format correctly in File Explorer, or creating a fresh partition layout. Be careful: commands such as clean and format can remove data. Always confirm the selected disk number with list disk and detail disk before making changes.
Recommended Free Tools
Cleaning a disk
The clean command removes partition information from the selected disk. This makes the disk appear unallocated in Windows Disk Management and is commonly used before rebuilding partitions. For example, to wipe the partition layout from a USB drive, you might use:
Rank #4
- Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
- Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
- To get set up, connect the portable hard drive to a computer for automatic recognition no software required
- This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
- The available storage capacity may vary.
- list disk to show all connected disks.
- select disk 2 to choose the target disk, replacing 2 with the correct disk number.
- detail disk to verify the model, size, and volumes on that disk.
- clean to remove the existing partition table.
There is also a clean all command, which writes zeros across the entire disk. It takes much longer and is usually unnecessary for routine setup. For most beginner tasks, clean is enough, but it still makes existing partitions inaccessible unless you recover them with specialized tools.
Creating a new partition
After cleaning a disk, you need to create at least one partition before Windows can store files on it. The most common command is create partition primary, which creates a primary partition using the available space on the selected disk. A typical sequence looks like this:
- select disk 2
- clean
- create partition primary
- select partition 1
- active, only for legacy BIOS boot disks when specifically required
You can also create a partition with a specific size by adding the size parameter. For example, create partition primary size=32768 creates a partition of about 32 GB because Diskpart uses megabytes for the size value.
Formatting and assigning a drive letter
A new partition must be formatted with a file system before it is usable. For most internal Windows drives, NTFS is the standard choice. For USB drives that need to work across Windows, macOS, TVs, and other devices, exFAT is often a better option. A quick format is much faster than a full format and is commonly used on healthy drives.
- format fs=ntfs quick label=Data formats the selected partition as NTFS and names it Data.
- format fs=exfat quick label=USB formats the selected partition as exFAT and names it USB.
- assign letter=E assigns the drive letter E to the selected partition.
- assign lets Windows automatically choose the next available drive letter.
For a complete example, preparing a new USB drive might look like this: list disk, select disk 2, clean, create partition primary, format fs=exfat quick label=USB, and assign letter=E. After these commands finish, the drive should appear in File Explorer with the assigned letter. If the letter is already in use, choose another available one such as F or use assign without specifying a letter.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Diskpart Safety Tips and Troubleshooting
Diskpart is powerful because it works directly with disks, partitions, and volumes. A single wrong selection can erase the wrong drive, remove partitions, or make Windows unbootable. Before running commands such as clean, delete partition, format, or convert, confirm that you have a current backup of any files you cannot afford to lose. If you are working on an external USB drive or SD card, disconnect other removable drives first so there is less chance of selecting the wrong device.
Always identify the target disk carefully before changing it. Use list disk, then compare disk sizes, free space, and online status. After selecting a disk with select disk 2, run detail disk to view the model, volume list, and other identifying information. For volumes, use list volume and detail volume. Do not rely only on drive letters, since they can change between Windows sessions, recovery environments, or different computers.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Fix the driver behind crashes, sound loss and screen glitches3Clear out junk files and repair common Windows errorsSafer habits before running destructive commands
- Read the command twice before pressing Enter, especially when using clean or format.
- Check the selected object with detail disk, detail partition, or detail volume.
- Avoid experimenting on your system drive, usually Disk 0, unless you are following a trusted repair procedure.
- Use Disk Management first for simple tasks if you are uncomfortable with command-line tools.
- Keep recovery media nearby when changing boot, system, EFI, or recovery partitions.
If Diskpart shows Access is denied, make sure Command Prompt, Windows Terminal, or PowerShell was opened as administrator. If the drive is write-protected, run attributes disk after selecting the disk. If it shows read-only status, try attributes disk clear readonly. Some USB drives and SD cards also have a physical lock switch, and some failing drives may become read-only at the hardware level, which Diskpart cannot fix.
Best Value
- [Upgraded Version] - This external hard drive features a mirrored logo stripe combined with a striped anti-slip design, and the rounded corners of the casing make it easier to grip. The stripes also have a heat dissipation function, ensuring stable and fast data transfer.
- 【Ultra-thin and quiet】 - The motherboard adopts JMicron 578 noise-free solution, giving you a quiet working environment. Lightweight and portable size designed to fit in your pocket for easy portability.
- 【Ultra-Fast Data Transfers】 - Pairing this external hard drive with JMicron 578 solution USB 3.0 and USB 2.0 interfaces enables blazing-fast data transfer. It boasts theoretical read speeds of up to 125MB/s and write speeds of up to 103MB/s.
- 【Plug and Play】 - With no software to install, just plug it in and the drive is ready to use.The hard disk chip is wrapped with an aluminum anti-interference layer to increase heat dissipation and protect data.
- 【What You Get】 - 1 x Portable Hard Drive, 1 x USB 3.0 Cable, 1 x User Manual, Gift-type shell packaging ,Three-year manufacturer's warranty and free technical support services.
If a disk does not appear in list disk, check the cable, USB port, enclosure, or card reader. Open Device Manager and look for hardware errors, then try another computer if possible. If a disk appears as No Media, the USB adapter or flash drive may be faulty. If a disk appears as Offline, select it and use online disk. If Windows reports a signature collision, bringing the disk online may assign a new signature, but cloning-related boot problems may still require extra repair steps.
Formatting errors often happen when a volume is in use, the file system is damaged, or the selected object is wrong. Close File Explorer windows and apps that may be using the drive, then try again. For removable drives, a full format can take much longer than a quick format but may reveal bad sectors. If clean succeeds but create partition primary fails, unplug and reconnect the drive, reopen Diskpart, and check whether the disk is still online and writable.
If Windows no longer boots after partition changes, stop making further changes and use Windows Recovery Environment. Startup Repair, System Restore, or restoring from a full backup may be safer than continuing with Diskpart. For drives containing valuable data, do not run clean, initialize the disk, or create new partitions just to “see what happens.” Use data recovery software or a professional recovery service before writing anything new to the disk.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Frequently Asked Questions
Does Diskpart delete files when I use it?
Diskpart does not delete files just by opening it or listing disks, volumes, and partitions. However, commands such as clean, delete partition, and format can erase data or make it inaccessible. Always confirm the selected disk or volume with list disk, list volume, or detail disk before running any destructive command.
How do I know which disk to select in Diskpart?
Use list disk to compare disk sizes, then select the suspected disk with select disk number and run detail disk to see more information. If you are working with a USB drive or external disk, unplugging other removable drives can reduce confusion. Never select a disk based only on its number, because disk numbers can change between sessions.
What is the difference between clean and clean all in Diskpart?
clean removes partition information from the selected disk, making it appear unallocated, but it does not overwrite every sector. clean all writes zeros across the entire disk, which takes much longer and is more difficult to recover from. For most beginner partitioning tasks, clean is usually used, but both commands can cause data loss.
Can I use Diskpart to fix a USB drive that is not showing in File Explorer?
Yes, if the USB drive appears in Diskpart, you may be able to create a partition, format it, and assign a drive letter. Common commands include list disk, select disk, create partition primary, format fs=exfat quick, and assign. If the drive does not appear in Diskpart at all, the issue may be hardware-related, driver-related, or caused by a faulty USB port.
Should I use Diskpart instead of Disk Management?
Disk Management is usually safer and easier for beginners because it provides a visual interface. Diskpart is useful when Disk Management cannot complete a task, when you need precise control, or when following repair steps from Microsoft or an IT guide. If you are unsure, use Disk Management first and switch to Diskpart only when you understand exactly which disk, volume, or partition you are changing.
Bottom Line
Diskpart is a powerful Windows command-line tool for viewing, selecting, cleaning, partitioning, formatting, and managing disks, but it should always be used carefully. A single command on the wrong drive can erase data, so double-check disk numbers, volumes, and partitions before making changes.
If you are new to Diskpart, start with safe commands like list disk, list volume, and detail disk before moving on to tasks such as cleaning or formatting. When in doubt, back up your files first and use Disk Management or another beginner-friendly tool for routine storage tasks.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →




