Here we can see, “diskpart – Guide for Windows XP, Vista, 7, 8, 10”
This post will show you how to utilize the diskpart utility in Windows XP, Vista, 7, 8, 8.1, and 10.
What exactly is diskpart?
To create or delete partitions on your computer, use the diskpart software (available in Windows 2000, XP, Vista, 7, 8, 8.1, and 10)
You can use the tool to:
- Partion
- Remove partitions
- Remove formatting
- Assign and remove drive letters and mount points
- Convert disks from basic to dynamic
- Create and extend volumes
Most of the commands available in Disk Management (see Boot partitions) are also available with diskpart. You must open Command Prompt and type diskpart because it is a command-line utility.
You can type diskpart in Run, click OK, or press Enter to launch Command Prompt with diskpart loaded on Windows Vista, 7, 8, and 10 computers.
The version installed on your computer will be seen when the program is loaded:
Microsoft DiskPart version 6.1.7600 Copyright 1999-2008 Microsoft Corporation. On Computer: MY_COMPUTER
Commands and Parameters
The following commands and parameters are available in the diskpart tool:
- select — choose allows you to focus on a single object.
- Select disc — this command allows you to focus on a single disc.
- Select partition — To focus on a specific partition, use the select partition command.
- Select volume — emphasizes a specified volume with this command.
- detail disk — The information about the present disc will be delivered via detail disc.
- detail partition — The information about the current partition will be delivered as a detailed partition.
- detail volume — The information about the current volume will be delivered in detail volume.
- list disc — Get a summary of the accessible discs on your computer using list disc.
- list partition — Use this command to see a list of all the available partitions on a given disc.
- list volume — list volume is a command that displays information about each volume on the computer.
- active — Use the active command to make the current partition the active partition.
- assign — Use assign to give the current active partition a letter or a mount point.
- create partition primary size=SIZE_IN_MB – use this command to create a new primary partition. The SIZE_IN_MB is the size of the partition you want to create, in MB.
- create partition extended size=SIZE_IN_MB – use this command to create a new extended partition. The SIZE_IN_MB is the size of the partition you want to create, in MB.
- create partition logical size=SIZE_IN_MB – use this command to create a new logical partition. The SIZE_IN_MB is the size of the partition you want to create, in MB.
- delete partition — The current active partition will be deleted if you select to remove the partition.
- extend — The current volume will be extended with the command expansion.
- remove — Removes a letter or mount point from the currently active partition.
- active — this is used to make the current volume active.
- add disk — add a mirror to the current active volume using this command.
- break disk — this command is used to break the mirror that has been added.
- create volume stripe – start a streak set volume on a specified disc with this command.
- create volume raid — 5 volume on a specified disc with the command create volume raid.
- delete disk – delete a missing dynamic disc using this command.
- delete partition — this command is used to remove the currently active partition.
- extend disk — this command allows you to expand the current volume.
- import — can bring discs from another disc group into the system.
- Online — can be used to bring a previously offline disc or volume online.
- remove — Use the remove command to remove a letter or a mount point from the current active volume.
- retain — Use the keep command to prepare a volume for use as a boot or system volume.
- convert mbr — The command convert MBR will change the present disk’s partition style to MBR.
- convert gpt — The partition style will be changed to GPT using convert gpt.
- convert dynamic — A basic disc will be converted to a dynamic disc using the convert dynamic command.
- convert basic — A dynamic disc (empty disc) will be converted to a basic disc with convert basic.
- exit — The utility will be terminated if you type exit.
- clean — The partition or volume formatting on the current drive will be removed using clean.
- rescan — The I/O buses can be rescanned, and new discs attached to the computer can be discovered with rescanning.
- help — The command help will show you a list of all accessible commands.
Error Codes
To debug various issues, here is a list of error codes:
- Code 0 means that no errors occurred
- Code 1 means that a fatal exception occurred.
- Code 2 means that the parameters you specified for a command are incorrect.
- Code 3 means that diskpart is unable to open the specified file.
- Code 4 means that diskpart (one of the services used by the utility) returned a failure.
- Code 5 means a command syntax error.
In Windows XP, Use diskpart
On Windows XP systems, the fdisk program seen on pre-Windows XP systems is now known as diskpart.
If you’re able to boot into Windows XP, that is
If you can get into your computer, all you have to do now is open Command Prompt and type diskpart:
- Startup Windows XP.
- Click Start.
- To begin, press the Run button.
- Type Cmd
- Click OK or press Enter.
- Type diskpart in the Command Prompt window.
- Press Enter
If you’re having trouble booting into Windows XP
You have two choices if you can’t boot into Windows XP to access diskpart:
- To get to Recovery Console, you’ll need the original CD.
- Launch Command-Line with Easy Recovery Essentials.
If you have the original CD:
You can use the Recovery Console if you can’t boot into Windows XP but have the original CD:
- Place the Windows XP CD in the drive.
- Restart your computer.
- To boot from the CD, press any key.
- Press R on the Microsoft Setup menu.
- Select the operating system and, if prompted, provide the Administrator password.
- Type diskpart into the Command Line when it appears.
- Press Enter.
If you use Easy Recovery Essentials:
- Download Easy Recovery Essentials
- The ISO image should be burned.
- Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
- Select Launch Command Line.
In Windows Vista, Use diskpart
Follow the If you can boot into Windows Vista set of steps if you can boot into Windows Vista without issues. If you can’t boot into Windows Vista, go to.
If you’re able to boot into Windows Vista, that is
If you can boot into Windows Vista, all you have to do is open Command Prompt:
- Startup Windows Vista.
- Click Start
- Type Cmd
- From the list of search results, select Command Prompt. If you are not currently logged in as Administrator, right-click Command Prompt > Run as Administrator.
- Type diskpart
- Press Enter.
If you are unable to start Windows Vista
You have the following choices if you are unable to boot into your system:
- To get to System Recovery Options, use the installation CD.
- You can use System Recovery Options even if you don’t have the installation CD (if installed).
- Access Command-Line with Easy Recovery Essentials.
If you have the installation DVD:
Follow these procedures to launch diskpart if you can’t boot into Windows Vista but have the Windows Vista disc:
- In the optical drive, place the original CD/DVD.
- Startup your PC.
- To boot from the CD/DVD, press any key.
- Choose your preferred language, time, and keyboard.
- Click Next
- Select Repair your computer.
- Choose an operating system.
- Click Next
- Click Command Prompt when the System Recovery Options box appears.
- Type Diskpart:
diskpart
11. Press Enter.
If you don’t have the installation DVD:
You can launch Command Prompt from the Advanced Boot Options menu if you have the System Recovery Options installed on your Windows Vista computer. Otherwise, check the instructions below under “If you utilise Easy Recovery Essentials.”
To access diskpart without the installation DVD, follow the procedures below:
- Restart your computer.
- As your computer begins to load up, but before the Windows Vista logo displays, press F8.
- At the Advanced Boot Options menu, choose to Repair Your Computer.
- From the System Recovery Options menu, choose Command Prompt.
- Type diskpart.
- Press Enter.
If you use Easy Recovery Essentials:
You can use Easy Recovery Essentials to access Command Prompt and load diskpart if you don’t have the installation disc, can’t boot into Windows Vista, or don’t have the “Repair Your Computer” option listed under the Advanced Boot Options menu.
Take the following steps:
- Download Easy Recovery Essentials
- The ISO image should be burned.
- Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
- Select Launch Command Line.
In Windows 7, Use diskpart
You can use diskpart on Windows 7 systems in the same way you can on Windows Vista systems.
If you’re able to boot into Windows 7
Simply launch Command Prompt: if you can boot into your Windows 7 PC.
- Startup Windows 7.
- Click Start.
- Type Cmd
- From the list of search results, select Command Prompt. Run as Administrator by right-clicking on Command Prompt.
- Type diskpart into the Command Prompt when it appears.
- Press Enter.
If you cannot boot into Windows 7
If you can’t boot into your machine, you have the same choices as with Windows Vista:
- Use the installation CD to get started.
- To access System Recovery Options, go to the Advanced Boot Options menu.
- Access Command-Line with Easy Recovery Essentials.
If you have the installation DVD:
If you can’t get Windows 7 to boot but you have the installation CD, you can use it to run diskpart. To do so, take the following steps:
- Place the disc in your computer’s optical drive.
- Restart the computer if necessary.
- To boot from the DVD, press any key.
- Choose your favorite keyboard, language, and time.
- Click Next.
- At the Install Windows screen, select Repair your computer.
- Choose an operating system from the drop-down menu.
- Click Next
- Choose Command Prompt from the drop-down menu.
- Type diskpart
diskpart
11. Press Enter.
If you don’t have the installation DVD:
On most Windows 7 computers, the System Recovery Options should be installed on the hard disc. If it isn’t (follow the procedures below), use the “If you use Easy Recovery Essentials” set of instructions below to access diskpart differently.
To access diskpart on a Windows 7 computer without an installation CD, follow these steps:
- Restart the computer if necessary.
- As the computer begins to boot, press F8. Before the Windows 7 logo shows, press F8.
- At the Advanced Boot Options screen, choose to Repair Your Computer.
- Press Enter.
- Choose Command Prompt
- Type diskpart
- Press Enter.
If you use Easy Recovery Essentials:
Any CD, DVD, or USB flash drive can be used to run Easy Recovery Essentials.
Follow these steps to use Easy Recovery Essentials to access diskpart:
- Download Easy Recovery Essentials
- The ISO image should be burned.
- Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
- Select Launch Command Line.
In Windows 8, Use diskpart
If you’re able to boot into Windows 8
If you can boot into Windows 8, you have to open Command Prompt to get to diskpart. To do so, take the following steps:
- Startup Windows 8.
- To open the charm bar, press the Windows key and C simultaneously.
- Type Cmd
- In the search box, type Command Prompt.
- Type diskpart into the Command Prompt when it appears.
- Press Enter.
If you are unable to boot into Windows 8
If you are unable to boot into Windows 8, you have the following options:
- To access the Repair your computer option in Windows 8 or Windows 8.1, use the original DVD or USB.
- With Shift and F8, enter the System Recovery Options.
- Launch Command-Line with Easy Recovery Essentials.
If you have the installation DVD:
Follow these instructions if you can’t boot but have the installation disc:
- Place the Windows 8 DVD or 8.1 USB drive in the drive.
- Restart the computer if necessary.
- To boot from the media, press any key.
- Press R or click Repair your computer.
- Select Troubleshoot.
- Choose Command Prompt.
- Type diskpart
- Press Enter.
If you don’t have the installation DVD:
If you don’t have the installation DVD, you can utilize Easy Recovery Essentials or boot into System Recovery Options.
Follow these procedures to access diskpart without a Windows 8 or Windows 8.1 disc:
- Restart the computer.
- Immediately press Shift and F8.
- Select Troubleshoot from the Choose an option menu.
- Choose Command Prompt.
- Type diskpart
- Press Enter.
If you use Easy Recovery Essentials:
Any CD, DVD, or USB flash drive can be used to run Easy Recovery Essentials.
Follow these steps to use Easy Recovery Essentials to access diskpart:
- Download Easy Recovery Essentials
- The ISO image should be burned.
- Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
- Select Launch Command Line.
In Windows 10, Use diskpart
If you’re able to boot into Windows 10
If you can boot onto Windows 10, you have to open Command Prompt to get to diskpart. To do so, take the following steps:
- Startup Windows 10.
- To open the charm bar, press the Windows key and C simultaneously.
- Type Cmd
- Select Command Prompt.
- Type diskpart into the Command Prompt when it appears.
- Press Enter
If you are unable to boot into Windows 10
If you are unable to boot into Windows 10, you have the following options:
- To access the Repair your machine option in Windows 10, use the original DVD or USB.
- With Shift and F8, enter the System Recovery Options.
- Launch Command-Line with Easy Recovery Essentials.
If you have the installation DVD:
Follow these instructions if you can’t boot but have the installation disc:
- Place the Windows 10 or USB drive into the computer.
- Restart the computer if necessary.
- To boot from the media, press any key.
- Press R or click Repair your computer.
- Select Troubleshoot.
- Choose Command Prompt.
- Type diskpart
- Press Enter.
If you don’t have the installation DVD:
If you don’t have the installation DVD, you can utilize Easy Recovery Essentials or boot into System Recovery Options.
Follow these steps to access diskpart without using official Windows 10 media:
- Restart the computer.
- Immediately press Shift and F8.
- Select Troubleshoot from the Choose an option menu.
- Choose Command Prompt.
- Type diskpart
- Press Enter.
If you use Easy Recovery Essentials:
Any CD, DVD, or USB flash drive can be used to run Easy Recovery Essentials.
Follow these steps to use Easy Recovery Essentials to access diskpart:
- Download Easy Recovery Essentials
- The ISO image should be burned.
- Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
- Select Launch Command Line.
Troubleshooting
Diskpart can be used to format a USB drive
Follow these instructions to format a USB flash drive with diskpart:
- In Command Prompt, type diskpart to launch the utility.
- Press Enter
- Once the program has loaded, type list disk:
list disk
4. Press Enter
5. Decide which of the offered discs is your USB flash drive, for example, Disk 2.
6. If 2 is the USB flash device shown by the list disc command, type select disk 2.
7. Press Enter
8. To clean the USB flash drive, type clean:
clean
9. Press Enter.
10. Type this command:
create partition primary
11. Press Enter
12. Type active:
active
13. Press Enter
14. This confirmation message should now arrive in your inbox:
DiskPart marked the current partition as active.
15. Type the following command to format the USB flash drive:
format fs=ntfs label="MY USB DRIVE"
where NTFS is the NTFS file system (you can also use fs=fat32) and “MY USB DRIVE” is the USB drive’s label.
16. Type assign:
assign
17. Press Enter
18. Type exit to quit diskpart:
exit
19. Press Enter
Diskpart can be used to create a bootable USB drive
Follow the procedures in the Format USB using the diskpart section to build a bootable USB.
Simply copy the files to the USB drive once the drive has been correctly formatted.
Diskpart does not recognize USB drives
If you’re using Windows XP, external media, such as a USB flash drive, will not be listed in diskpart.
The USB flash devices will be shown in diskpart on Windows Vista and Windows 8.
Conclusion
I hope this information was helpful. If you have anything to add, please do so in the comments.
User Questions
1. What are diskpart commands, and how do I use them?
DiskPart is a command interpreter that works in text mode. Using scripts or direct input at a command prompt, you can manage objects (disks, partitions, or volumes) with this tool. Open a DOS prompt and type diskpart into it to use this program. In a different window, the DiskPart utility will display.
2. What is the best way to utilize the diskpart command?
Type diskpart at the command prompt and hit Enter. The prompt for diskpart will appear. Type list disc at the disk part prompt and hit Enter. In a text format, a list of discs will show.
3. How do I use diskpart to clean?
Type “clean” and hit Enter at the diskpart prompt. You will not have the option to opt-out. The disc will be deleted after you press Enter. If you type “list disc” again, you’ll notice that the cleaned disc now says that the entire drive is free.
4. Diskpart is an awesome tool!
5. Access is denied on DiskPart when trying to clean SanDisk Ultra Fit used as bootable drive
Access is denied on DiskPart when trying to clean SanDisk Ultra Fit used as bootable drive from Windows10