diskpart – Guide for Windows XP, Vista, 7, 8, 10

422
diskpart – Guide for Windows XP, Vista, 7, 8, 10

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.
Also See:  How to Use Onedrive Diagnostic Tools for Windows 7,10

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:

  1. Startup Windows XP.
  2. Click Start.
  3. To begin, press the Run button.
  4. Type Cmd
  5. Click OK or press Enter.
  6. Type diskpart in the Command Prompt window.
  7. 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:

  1. Place the Windows XP CD in the drive.
  2. Restart your computer.
  3. To boot from the CD, press any key.
  4. Press R on the Microsoft Setup menu.
  5. Select the operating system and, if prompted, provide the Administrator password.
  6. Type diskpart into the Command Line when it appears.
  7. Press Enter.

If you use Easy Recovery Essentials:

  1. Download Easy Recovery Essentials
  2. The ISO image should be burned.
  3. Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
  4. 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:

  1. Startup Windows Vista.
  2. Click Start
  3. Type Cmd
  4. 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.
  5. Type diskpart
  6. 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:

  1. In the optical drive, place the original CD/DVD.
  2. Startup your PC.
  3. To boot from the CD/DVD, press any key.
  4. Choose your preferred language, time, and keyboard.
  5. Click Next
  6. Select Repair your computer.
  7. Choose an operating system.
  8. Click Next
  9. Click Command Prompt when the System Recovery Options box appears.
  10. 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:

  1. Restart your computer.
  2. As your computer begins to load up, but before the Windows Vista logo displays, press F8.
  3. At the Advanced Boot Options menu, choose to Repair Your Computer.
  4. From the System Recovery Options menu, choose Command Prompt.
  5. Type diskpart.
  6. 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:

  1. Download Easy Recovery Essentials
  2. The ISO image should be burned.
  3. Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
  4. 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.

  1. Startup Windows 7.
  2. Click Start.
  3. Type Cmd
  4. From the list of search results, select Command Prompt. Run as Administrator by right-clicking on Command Prompt.
  5. Type diskpart into the Command Prompt when it appears.
  6. 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:

  1. Place the disc in your computer’s optical drive.
  2. Restart the computer if necessary.
  3. To boot from the DVD, press any key.
  4. Choose your favorite keyboard, language, and time.
  5. Click Next.
  6. At the Install Windows screen, select Repair your computer.
  7. Choose an operating system from the drop-down menu.
  8. Click Next
  9. Choose Command Prompt from the drop-down menu.
  10. 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:

  1. Restart the computer if necessary.
  2. As the computer begins to boot, press F8. Before the Windows 7 logo shows, press F8.
  3. At the Advanced Boot Options screen, choose to Repair Your Computer.
  4. Press Enter.
  5. Choose Command Prompt
  6. Type diskpart
  7. 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:

  1. Download Easy Recovery Essentials
  2. The ISO image should be burned.
  3. Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
  4. Select Launch Command Line.
Also See:  Android Fix: ‘Unknown Install Error 961’

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:

  1. Startup Windows 8.
  2. To open the charm bar, press the Windows key and C simultaneously.
  3. Type Cmd
  4. In the search box, type Command Prompt.
  5. Type diskpart into the Command Prompt when it appears.
  6. 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:

  1. Place the Windows 8 DVD or 8.1 USB drive in the drive.
  2. Restart the computer if necessary.
  3. To boot from the media, press any key.
  4. Press R or click Repair your computer.
  5. Select Troubleshoot.
  6. Choose Command Prompt.
  7. Type diskpart
  8. 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:

  1. Restart the computer.
  2. Immediately press Shift and F8.
  3. Select Troubleshoot from the Choose an option menu.
  4. Choose Command Prompt.
  5. Type diskpart
  6. 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:

  1. Download Easy Recovery Essentials
  2. The ISO image should be burned.
  3. Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
  4. 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:

  1. Place the Windows 10 or USB drive into the computer.
  2. Restart the computer if necessary.
  3. To boot from the media, press any key.
  4. Press R or click Repair your computer.
  5. Select Troubleshoot.
  6. Choose Command Prompt.
  7. Type diskpart
  8. 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:

  1. Restart the computer.
  2. Immediately press Shift and F8.
  3. Select Troubleshoot from the Choose an option menu.
  4. Choose Command Prompt.
  5. Type diskpart
  6. 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:

  1. Download Easy Recovery Essentials
  2. The ISO image should be burned.
  3. Easy Recovery Essentials can be started from a CD, DVD, or USB drive.
  4. 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:

  1. In Command Prompt, type diskpart to launch the utility.
  2. Press Enter
  3. 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.

Also See:  How to Set a Partition as Active

4. Diskpart is an awesome tool!

Diskpart is an awesome tool! from sysadmin

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