Команды diskpart windows 10

Sometimes the disk on your Windows 10 system may not work correctly, or the Windows fails to start because of the hard disk error. To rectify such disk errors, Windows 10 comes with an excellent tool known as DiskPart.

The DiskPart is a powerful command tool that lets you manage the Windows disks and partitions using Command Prompt or Windows PowerShell. This command interpreter allows you to delete, create, and modify partitions on any drives your PC can detect, even the external hard drives and USB storage. It is quite useful when any Pendrive or hard disks get corrupted because of logical errors and stopped working. Using DiskPart commands, you can wipe out the data and start clean.

To fix various Windows 10/11 problems, we recommend Outbyte PC Repair:
This software will repair common computer errors, protect you from file loss, malware damage, hardware failure, and optimise your computer for peak performance. In three simple steps, you can resolve PC issues and remove virus damage:

  1. Download Outbyte PC Repair Software
  2. Click Start Scan to detect Windows 10/11 issues that may be causing PC issues.
  3. Click Repair All to fix issues with your computer’s security and performance.
    This month, Outbyte has been downloaded by 23,167 readers.

DiskPart is not a new concept. It has been the part of the Windows even before Windows 10. It is the best alternative when other disk utility such as Disk Management Tool fails to work.

In this guide, we would learn to use the common DiskPart commands to fix ‘Drive not Working’ and other disk errors.

How to open DiskPart on Windows 10?

Launching the DiskPart is not a big task. You just require to open the command terminals, either the Command Prompt or Windows PowerShell with the administrative rights. 

In this guide, we would use the Command Prompt to run the DiskPart commands. The same commands can be directly used in Windows PowerShell without any changes.

  1. Search Command Prompt in the Windows search bar and launch it with admin rights.

    Open Command Prompt as Admin

  2. In the command window, type diskpart and hit enter. The DISKPART tool would be open and ready to use.

    launch DISKPART

  3. If you want to glance on the full list of available commands of DiskPart type help in the command window and press the enter key.

    diskpart help command

  4. After using it, type Exit and hit the enter key to exit the tool.

    Exit DiskPart

Common DiskPart Commands

We would now explore the common DiskPart Command Prompt commands that you will mostly require.

Command Description
ACTIVE Mark the selected partition as active.
ADD Add a mirror to a simple volume.
ASSIGN Assign a drive letter or mount point to the selected volume.
ATTRIBUTES Manipulate volume or disk attributes.
ATTACH Attaches a virtual disk file.
AUTOMOUNT Enable and disable automatic mounting of basic volumes.
BREAK Break a mirror set.
CLEAN Clear the configuration information, or all information, off the disk.
COMPACT Attempts to reduce the physical size of the file.
CONVERT Convert between different disk formats.
CREATE Create a volume, partition, or virtual disk. (No virtual disk management in Windows XP.)
DELETE Delete an object.
DETAIL Provide details about an object.
DETACH Detaches a virtual disk file.
EXIT Exit DiskPart.
EXTEND Extend a volume.
EXPAND Expands the maximum size available on a virtual disk
FILESYSTEMS Display current and supported file systems on the volume.
FORMAT Format the volume or partition.
GPT Assign attributes to the selected GPT partition.
HELP Display a list of commands.
IMPORT Import a disk group.
INACTIVE Mark the selected partition as inactive.
LIST Display a list of objects.
MERGE Merges a child disk with its parents.
ONLINE Online an object that is currently marked as offline.
OFFLINE Offline an object that is currently marked as online.
RECOVER Refreshes the state of all disks in the selected pack. Attempts recovery on disks in the invalid pack, and resynchronizes mirrored volumes and RAID5 volumes that have stale plex or parity data
REM Does nothing. This is used to comment scripts.
REMOVE Remove a drive letter or mount point assignment.
REPAIR Repair a RAID-5 volume with a failed member.
RESCAN Rescan the computer looking for disks and volumes.
RETAIN Place a retained partition under a simple volume.
SAN Display or set the SAN policy for the currently booted OS.
SELECT Shift the focus to an object.
SETID Change the partition type.
SHRINK Reduce the size of the selected volume.
UNIQUEID Displays or sets the GUID partition table (GPT) identifier or master boot record (MBR) signature of a disk.

Listing Existing Hard Drives, Volumes & Partitions using DiskPart

Before applying any destructive commands, you can first check the current internal and external hard disks and USB storage layout.

To check the available disks:

  1. Open the DiskPart and after “DISKPART>” prompt type list disk and hit enter. This command will list all the available and detectable storage disks, including internal and external drives and USB storage.
    Diskpart list disk command

  2. To apply the DiskPart commands on the disks, you need to remember the disk number. For example, the windows disk is “Disk 0.

To display the list of detected Volumes:

  1. Launch DiskPart and next to “DISKPART>” prompt type list volume.
    diskpart list volume command

  2. All volumes would be listed.

Check the list of partitions:

  1. To check the partition list, you must first select the hard disk with the list disk command.
  2. After the disk list is displayed, type select disk followed by the disk number.
    diskpart select disk command

  3. Once the disk is selected, type list partition, and hit the enter key, the selected disk’s partition list will be displayed. You can further modify the partitions using the partition number.
    Diskpart list partition command


How to Delete Hard Drive, Volume, and Partition using DiskPart ?

If you want to delete the Volume or Partition of your system’s hard disk using Diskpart, follow these steps:

  1. First, select the hard drive using the select disk command, followed by the disk number.
  2. Now open the partition list of the chosen disk using list partition command.
  3. Chose the partition using select partition # command, replace with the required partition number.
  4. Once the partition is selected, you can delete it using the delete partition command. The partition will be deleted.
    Select and Delete the Partition using DiskPart

  5. Similarly, you can delete the disk volume. Type list volume, check your chosen volume number, then type select volume #, replacing # with your volume number.
    Delete volume using DiskPart

  6. Type delete volume, to delete the chosen volume.

How to Completely Wipe Out the Hard Disk using DiskPart?

If you face a problem in formatting the system hard disk, external hard drive, or the USB Pendrive, then using DiskPart, you can easily wipe them out. Obviously, you won’t be able to clean the disk on which your OS is installed.

  1. Similar to previous steps, on the DISKPART prompt window, type list disk.
  2. By typing select disk # command where is your disk number, choose the disk that you want to format completely.
  3. After selecting the disk, type clean command to format it completely. Remember that it would not warn you, so make sure that you have selected the correct disk.
    Clean disk using DiskPart

  4. After the cleanup, DiskPart would display the success message, and the disk would be ready for creating the new partitions. 

How to Create and Format New Hard Drive Partitions using DiskPart?

Using the steps from the last section, you might have cleaned your hard disk. Now its time to create the new partitions and format them with Windows-friendly file systems like NTFS or FAT32.

create a new partition using diskpart

  1. Open the disk list using the list disk command and select the disk using the select disk # command, where # is the disk number.
  2.  After selecting the disk type the create partition primary command to create a partition using the entire space on that drive.
  3. If you want to create multiple partitions, you can assign how much space a partition could take. For that type, create partition primary size=X, where X is the size that you wish to set to the partition.
  4. To ensure that the new partition is listed, type list partition command.
  5. Use active command to activate the partition. It is required to use the partition as a bootable drive.
  6. To format the partition with the NTFS file system, use format FS=NTFS label=Data quick command. You can replace Data with any label you want.
  7. After it gets format, the DiskPart would automatically assign the letter to the partition. If it doesn’t, you can manually set it. For that type, assign letter=g, where you can replace g with any drive letter that you want. 
Format the partition and assign letter to it using diskpart


Conclusion

These are the top used DiskPart commands that you can use to fix your hard drive problems and clean the USB drives and hard disks.

There are more commands, too, if you want to know about them, type help after launching DISKPART in the command window.

1. How to open DiskPart in Windows 10?

You can open DiskPart utility through Command Prompt or Windows PowerShell in Windows 10. After launching any of the command terminals, type diskpart to launch DiskPart.

2. How to fix hard drive problems with DiskPart?

DiskPart utility is specifically available for solving the disk issues on Windows 10. After launching the diskpart, type the help command to know about all the commands supported by diskpart. This post guides you on how to use the most common DiskPart commands.

Peter is an Electrical Engineer whose primary interest is tinkering with his computer. He is passionate about Windows 10 Platform and enjoys writing tips and tutorials about it.

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

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 command in Windows 11/10?

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.

Related: Fix There are no fixed disks to show.

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.

Related: How to undo DISKPART Clean command

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.

Related: There is not enough space available on the disk(s) to complete this operation.

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.

Read: Fix Diskpart failed to clear disk attributes.

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.

Related: DiskPart has encountered an error: Access is denied.

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.

Efficient hard drive management is essential for maintaining an organized and optimized computer system. Windows operating systems offer various tools to help users manage their data, and Diskpart is one such powerful utility. Diskpart allows users to manipulate hard drive partitions directly from the command line, providing granular control over disk space allocation.

Whether you want to create, extend, delete, or format partitions, Diskpart offers a command-line-driven approach that’s particularly useful for system administrators and advanced users. This guide delves into the details of using Diskpart to manage hard drive partitions effectively in Windows 11/10.

What is Diskpart?

Diskpart, short for “Disk Partition,” is a command-line utility included in Windows 11/10 that empowers users to manage disks, partitions, and volumes. Unlike graphical interfaces, Diskpart operates solely through text-based commands, offering a powerful way to interact with storage devices. It’s especially valuable for managing partitions in scenarios where the graphical interface might not be accessible, such as during system recovery or maintenance.

Diskpart provides a comprehensive set of commands that enable users to create new partitions, extend existing ones, format partitions with different file systems, and even remove partitions entirely. Its versatility and direct control over disk structures make it a preferred tool for those who require a more hands-on approach to disk management.

Precautions to take while using Diskpart commands

While Diskpart can be a highly effective tool, it’s essential to take precautions before using its commands to avoid unintended data loss or system disruptions. 

Here are some precautions to consider:

  • Backup Your Data: Before performing any disk management operations using Diskpart, create backups of your critical data. Diskpart commands can lead to irreversible changes, and having a backup ensures that you can restore your data if something goes wrong.
  • Double-Check Disk Selection: Make sure you’re selecting the correct disk and partition when applying Diskpart commands. A wrong selection can result in unintended changes to your system.
  • Understand Commands: Familiarize yourself with the specific commands you’re going to use and their implications. Misinterpreting commands can lead to data loss or system instability.
  • Use “List” Commands: Utilize commands like list disk, list partition, and list volume to get a clear view of your disk configuration before making any changes. This helps you verify your selections.
  • Avoid Direct “Clean” Command: Be cautious with the clean command, as it removes all partitions from a selected disk without confirmation. This command can lead to complete data loss if not used carefully.

List of common Diskpart commands

Diskpart commands are the building blocks of disk management. Here’s a list of common commands along with their purposes:

Command Use
list disk Displays a list of available disks.
select disk <number> Selects a specific disk for further actions.
detail disk Provides detailed information about the selected disk.
attributes disk clear Clears read-only or hidden attributes on a disk.
online disk Brings a disk online if it’s marked as offline.
offline disk Takes a disk offline to prevent it from being accessed.
clean Removes all partitions and volumes from a disk.
convert gpt Converts the selected disk to the GPT partition style.
convert mbr Converts the selected disk to the MBR partition style.
create partition primary size=<size> Creates a primary partition with a specified size.
create partition extended Creates an extended partition.
format fs=<filesystem> quick Formats a partition with the specified file system.
assign letter=<letter> Assigns a drive letter to a partition or volume.
remove letter=<letter> Removes a previously assigned drive letter.
active Marks the selected partition as active (bootable).
delete partition override Deletes the selected partition.
extend Extends a partition into adjacent unallocated space.
shrink desired=<size> Shrinks a partition by the specified size (MB).
create volume simple size=<size> Creates a simple volume with the specified size.
create volume stripe disk=<disk>... Creates a striped volume across specified disks.
create volume mirror disk=<disk>... Creates a mirrored volume across specified disks.
create volume raid5 disk=<disk>... Creates a RAID-5 volume across specified disks.
format quick Formats the selected volume quickly.
format fs=<filesystem> Formats the selected volume with the specified file system.
delete volume Deletes the selected volume.
list partition Shows all partitions on a selected disk.
list volume Lists all volumes on the system.
list volume verbose Provides detailed information about all volumes.
list partition verbose Provides detailed information about all partitions.
offline volume Takes the selected volume offline.
online volume Brings the selected volume online.

How to launch Diskpart on Windows 11/10

Launching Diskpart is a straightforward process. Here’s how you can do it:

  1. Press Windows + R to launch the Run Command box. 
  2. Type “cmd” and press Shift+Enter to open the Command Prompt with admin rights.
    Launch Command Prompt with Admin Rights

  3. In the Command Prompt, type diskpart and press Enter. This initiates the Diskpart utility.
    Diskpart Launched

  4. If prompted by User Account Control, click “Yes” to grant administrative privileges to Diskpart. You’ll now be within the Diskpart environment, ready to execute disk management commands.
  5. To view the complete list of available commands for DiskPart, simply type help in the command window and hit the enter key.
    Diskpart Commands

  6. After utilizing the Diskart, you can simply use the Exit command to come out of it.
    Exit Diskpart

How to check existing hard drives, volumes, & partitions using DiskPart

Before making any changes, it’s crucial to understand your disk’s current configuration. Diskpart can help you get this information:

  1. Open the Command Prompt and enter diskpart.
  2. Enter list disk to see a list of available disks on your system. Note or remember the disk number you want to work with.
    List Disk Command

  3. Type select disk <number> to choose the disk you want to inspect.
  4. Similarly, use the list partition and list volume commands to see the partitions and volumes on the selected disk.
List Partition

How to create a partition using Diskpart

Creating a partition using Diskpart provides you with control over its size, file system, and drive letter assignment. 

Creating a partition using Diskpart involves a few steps. Let’s go through the process:

  1. Launch Diskpart as described earlier.
  2. To access the disk list, use the list disk command, and then choose the desired disk by entering its corresponding number with the select disk # command, where “#” is the disk number.
  3. Before beginning to create a partition, you need to clean the disk so there are no partitions already. So, be very careful while selecting the disk for parting it. To ensure that you have selected the right disk for partitioning, again use the list disk command and look for the asterisk mark against your selected disk. The asterisk mark indicates that further commands will be taken under the selected disk.
    Ensure You Selected The Right Disk

  4. After selecting the disk, use the clean all command to wipe out the disk. (optional step)
  5. Once the disk is wiped out, use the create partition primary command to create a partition using the entire space on that drive.
  6. If you want to create multiple partitions, you can assign how much space a partition could take. For that, use the create partition primary size=X command, where “X” is the size that you wish to set to the partition in megabytes.
  7. After creating the partition, format it with a file system using the format fs=<filesystem> quick command. For instance, use the format fs=ntfs quick for NTFS or format fs=fat32 quick for FAT32.
  8. Once the formatting process is complete, Diskpart will automatically assign a letter to the partition. In the event that it does not, you can manually set it by using the command assign letter=<letter>. Replace “<letter>” with the desired drive letter. 
Create Partition Using Diskpart

You can also create an additional partition in an already partitioned disk. Just skip step 4, i.e., using the Clean command to sweep the disk. Use the create partition primary size=X command to create a partition of X MB. Ensure that enough space is available to create a partition on an already divided hard disk.

How to extend a partition using Diskpart

Extending a partition allows you to combine unallocated space with an existing partition. It’s an excellent way to make efficient use of available space.

Here’s how you can do it:

  1. Launch Diskpart using the earlier method.
  2. Make sure that there is enough free space adjacent to the partition you plan to extend on the same drive without any partitions in between. Verify the contiguous availability of the free space.
  3. Use the list disk command to list all the attached disks on your system. Choose the disk containing the partition you want to extend using the select disk <number>.
  4. Next, use the list volume command to get the list of all the volumes under the selected disk.
  5. Now, choose the volume that you want to extend using the select volume # command. Insert the volume number in place of “#”.
  6. Next, use the extend command to add the entire free space to the selected volume. However, if you don’t want to include the entire unallocated space to the selected volume, use the extend size=#, and replace “#” with the amount of space you want to extend in megabytes.
Extend The Disk Using Diskpart

How to shrink a volume using Diskpart

Shrinking a volume allows you to reclaim unused space, which can then be used to create new partitions or extend existing ones. Here’s how you can shrink a volume using Diskpart:

  1. Launch Diskpart using the previously outlined steps.
  2. Type list volume to see a list of all volumes on your system. Note the volume number of the one you want to shrink.
  3. Enter select volume <number> to choose the volume you wish to shrink.
  4. To initiate the shrinking process, type shrink desired=<size> and press Enter. Replace “<size>” with the amount of space you want to shrink the volume by in megabytes.
  5. Diskpart will calculate the available space that can be shrunk based on the specified size.
  6. Once the process is complete, you can exit Diskpart by typing exit and pressing Enter.
Shrink Volume Using The Diskpart

How to delete a partition using Diskpart

You can easily delete a partition, too, using Diskpart. Removing a partition should be done with caution, as it leads to data loss. Follow these steps:

  1. Open the Command Prompt and launch Diskpart.
  2. Select the disk containing the partition you want to delete using select disk <number>. If you don’t know the disk number, use the list disk command.
  3. Now, use the select partition <number> command to select the partition that you want to delete. Use the list partition command if you don’t know the partition number.
  4. After selecting the partition, use the delete partition command to delete it.
Delete A Partition Using Diskpart

Similarly, you can use the delete volume command to delete a partition.

How to completely wipe out the hard disk using DiskPart

If you encounter issues when formatting your system’s hard disk, an external hard drive, or a USB pen drive, you can use DiskPart to wipe them clean. However, please note that you cannot clean the disk on which your operating system is installed.

If you need to wipe out an entire hard disk using Diskpart, follow these steps with caution:

  1. Open the Command Prompt and enter diskpart.
  2. Type list disk and note the disk number you want to wipe.
  3. Select the disk by typing select disk <number>.
  4. Now type the clean all command and press Enter. This command will erase all data on the selected disk. Be patient; depending on the size of your hard disk, it could take even hours to complete this command.
Clean Disk Using Diskpart

Alternatives to Diskpart

While Diskpart is a powerful tool for managing hard drive partitions in Windows 11/10, there are alternative methods and third-party tools available for users who prefer different approaches. Here are a couple of alternatives to consider,

Windows Disk Management

Windows Disk Management

Windows provides a built-in graphical tool called “Disk Management.” To access it, right-click on the “Start” button and select “Disk Management.” This tool offers an intuitive interface where you can perform tasks like creating hard drive partitions, formatting, deleting, and resizing them. While it might not offer the same level of command-driven control as Diskpart, it’s user-friendly and suitable for most basic partition management needs.

Third-Party Partitioning Tools

Several third-party partitioning tools are available that provide advanced features and user-friendly interfaces. Tools like EaseUS Partition Master, MiniTool Partition Wizard, and AOMEI Partition Assistant offer capabilities beyond what Diskpart provides, including visual representations of your disk layout, more flexible partition resizing, and better data protection during operations. These tools can be especially useful for users who prefer not to work with command-line utilities.

FAQ

Can Diskpart commands be undone?

Unfortunately, Diskpart commands are irreversible and can lead to data loss if executed incorrectly. It’s crucial to double-check your commands and backup your data before making any changes using Diskpart.

Can I use Diskpart on external drives and USB devices?

Yes, Diskpart can be used on internal and external drives, including USB devices. However, exercise caution and make sure you select the correct disk to avoid accidental data loss.

Is it possible to resize volumes using Diskpart?

Yes, resizing the volume is possible using the Diskpart shrink and extend commands.

Manage your system hard drive easily

Effective hard drive management is essential for maintaining a well-organized and optimized computer system. Diskpart provides a versatile and powerful solution for managing hard drive partitions in Windows 11/10. By understanding its commands and following the steps outlined in this guide, you can confidently create, extend, delete, and manage partitions according to your needs. Remember to exercise caution, back up your data, and double-check your actions before executing Diskpart commands. With this knowledge, you’ll be well-equipped to make the most of your disk space while ensuring the safety of your data.

Looking for more? Check out these OnMSFT.com posts on Diskpart. We also have a guide that explains what is fdisk, so don’t hesitate to check it out.

Сегодня, нам бы хотелось рассказать вам, что из себя представляют Diskpart команды в Windows 10, так как достаточно маленькое количество пользователей ПК знает о них, а зря! Особенность этой стандартной утилиты заключается в том, что с ее помощью возможно максимально мастерски производить затирание имеющихся на жестких дисках данных. После работы с Diskpart на жестком диске, затертую информацию практически не возможно восстановить без специализированного оборудования, которого в домашних условиях точно не у кого нет. Таким образом, если вы собрались отдать свой жесткий диск другу или знакомому, то в первую очередь, необходимо обработать его программой Diskpart, а уже потом, расставаться с ним.

Diskpart команды в Windows 10

Для того, чтоб приступить к работе с жестким диском утилитой Diskpart, вам необходимо подключить к компьютеру тот жесткий диск, над которым будут производиться работы. После подключения, вы должны будите зайти в систему от имени Администратора и перейти в командную строку. В командной строке, вам придется ввести поочередной четыре небольшие команды:

  • diskpart
  • list disk
  • sеlеct disk 1
  • clean all

Каждая из вводимых вами команд имеете конкретные лог действий и производит с вашим жестким диском необратимые действия, а именно:

  • diskpart – запускает утилиту «Diskpart» (запуск возможен только от имени Администратора).
  • list disk – показывает все физические диски, которые подключены к ПК в данный момент.
  • sеlеct disk 1 – позволяет выбрать один из жестких дисков, который будет форматироваться. Если поставить цифру «0», то отформатирован будет системный жесткий диск даже несмотря на то, что на нем установлена Windows 10.
  • clean all – команда, которая производит запуск очистки. Данную команду стоит использовать только после того, как вы уже использовали предыдущие три.

Вот в принципе и все! На этом можно с полной уверенностью заявить, что Diskpart команды в Windows 10 теперь вы знаете и при необходимости, сможете использовать их для своих нужд.

P.S. Обратите внимание на то, что затирание секторов жесткого диска не происходить хаотично, а идет упорядочено. Кроме того, после затирания, каждый сектор жёсткого диска заполняется информацией в виде нолей, что делает практически невозможным восстановление данный с вашего HDD, так что будьте внимательны при выборе тех или иных команд Diskpart.

Встроенная утилита Diskpart — эффективное средство для исправления логических ошибок и восстановления жестких дисков, флешек и других запоминающих устройств.

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

Содержание

  1. Начало работы с Diskpart
  2. Как создать разделы и отформатировать стертый диск?
  3. Как удалить защищенный, активный и системный разделы жесткого диска?
  4. Удаление через командную строку в работающей ОС
  5. Удаление любых разделов
  6. Что делать если пропали важные данные?

Некорректная работа накопителей, неправильное отображение размера в проводнике, невозможность форматирования и другие неполадки – все эти проблемы значительно затрудняют использование флешек и жестких дисков, поэтому при обнаружении вышеуказанных неполадок следует сразу прибегнуть к их устранению.

Важно! Перед началом работы, следует позаботиться о сохранности информации на проблемном накопителе, поскольку для исправления проблемных дисков потребуется полное стирание, а также удаление таблицы разделов, что непременно приведет к удалению всей информации.

Начало работы с Diskpart

Для начала следует подключить проблемную флешку к компьютеру или точно определить необходимый накопитель. Это нужно для того, чтобы случайно не стереть нормально работающий диск с важной информацией. В нашем случае проблемным диском будет выступать флешка объемом 14.4 гигабайт.

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

После этого следует запустить командную строку или Windows PowerShell с правами администратора. Это можно сделать, нажав правой кнопкой мыши по «Пуск» и выбрав соответствующий пункт (командная строка(администратор) или Windows PowerShell(администратор)).

В открывшемся окне командной строки следует ввести команду «Diskpart» и нажать Enter (кнопка Enter подтверждает команды, поэтому её следует нажимать после каждой новой команды) для начала работы с утилитой.

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

Теперь необходимо точно определить проблемный диск в утилите. Для этого нужно ввести команду «list disk», отображающую весь список подключенных носителей.

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

Как видно из скриншота, утилита определила два диска: Диск 0 размером 111 гигабайт и диск 1 размером 14 гигабайт. Поскольку системный диск с большим размером работает нормально, а проблемы имеются именно с USB-флешкой объемом 14 гигабайт, запоминаем что в Diskpart она носит название «Диск 1».

Важно! В данном пункте следует точно определить необходимый диск, чтобы не удалить всю информацию с системного накопителя.

Выбираем проблемный накопитель командой «select disk 1» (если у пользователя установлены дополнительные диски, после команды select disk следует ввести число, соответствующее проблемному носителю).

Следующий шаг является финальным, поэтому рекомендуем еще раз перепроверить правильность выбранного диска. После выполнения команды все данные будут стерты. Для выполнения стирания выбранного диска, вводим команду «Clean» и подтверждаем Enter.

После стирания диска, Diskpart выдаст сообщение «Очистка диска выполнена успешно». После этого можно закрыть окно «Windows PowerShell».

Стоит отметить, что для нормальной работы стертого диска, на нем необходимо создать разделы и провести форматирование.

Как создать разделы и отформатировать стертый диск?

Стертый диск нуждается в создании на нем разделов и форматировании в нужной файловой системе. Для этого необходимо выполнить следующее:

Открываем меню «Управление дисками», нажав ПКМ по кнопке «Пуск» и выбрав соответствующий пункт.

В открывшемся окне находим стертый диск. Как правило, он не имеет буквы или вовсе не отображается в меню, но его можно обнаружить как нераспределенную область в нижней части окна. Нажимаем ПКМ по блоку область не распределена и выбираем первый пункт «Создать простой том».

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

В открывшихся окнах следует выбрать букву, а также файловую систему и размер диска. По умолчанию система сама выбирает максимальный размер, букву, а также файловую систему NTFS, поэтому в данном пункте можно просто нажимать «Далее».

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

Как удалить защищенный, активный и системный разделы жесткого диска?

Для удаления разделов жесткого диска можно воспользоваться функционалом встроенной утилиты «Управление дисками», где для удаления следует просто нажать по необходимому разделу правой кнопкой мыши и выбрать пункт «Удалить том…».

В некоторых случаях это может не сработать, поскольку:

  • Логический диск имеет поврежденную файловую систему (можно исправить проверкой Chkdsk).
  • На нем присутствуют сбойные сектора и бед блоки (решить проблему можно при помощи проверки бесплатной программой Victoria).
  • Логический диск защищен от удаления (от удаления защищены системные разделы, скрытые и служебные разделы и т.д.).

Тем не менее существует несколько способов позволяющих удалить абсолютно любой раздел.

Удаление через командную строку в работающей ОС

Для удаления ненужных защищенных разделов в работающей Windows можно воспользоваться командой строкой и встроенной утилитой Diskpart. Данный способ позволит удалить все проблемные разделы, кроме системных и служебных.

Для этого:

Шаг 1. Открываем командную строку от имени администратора и вводим поочередно команды: diskpart, list disk, select disk 0 (в нашем случае раздел расположен на диске 0), list part (команда открывает список разделов на диске).

Шаг 2. Выбираем необходимый раздел командой select partition 4, после этого вводим команду delete partition для удаления раздела.

Шаг 3. Финальным этапом станет создание нового раздела и его форматирование. Вводим поочередно: create partition primary, format fs=ntfs quick, assign letter Z (команда присваивает букву созданному разделу) и exit.

После выполнения данных действий, раннее заблокированный раздел будет готов к использованию, удалению и другим манипуляциям в меню «Управление дисками».

Удаление любых разделов

Чтобы провести удаление системных, зарезервированных и скрытых разделов, пользователю понадобиться загрузочная флешка или установочный диск. Загружаемся с них и в меню выбора языка нажимаем сочетание клавиш Shift+F10 для открытия командной строки.

Diskpart восстановление карты памяти, USB-флешки или жесткого диска

В командной строке, аналогично с предыдущим способом, вводим команды: diskpart, list disk, select disk 0, lis part, select partition 2 (или любой другой раздел, который невозможно удалить) и удаляем его командой del par override.

Стоит отметить, что команда del par override удаляет абсолютно любой раздел, независимо от его атрибутов.

Важно! Удаление некоторых разделов диска может повлиять на его работу, поэтому мы настоятельно не рекомендуем прибегать к удалению защищенных разделов.

Что делать если пропали важные данные?

Зачастую при манипуляциях с накопителем через командную строку пользователи случайно форматируют не тот накопитель или совершают действия, из-за которых теряются ценные данные.

Кроме того, нередки случаи, когда производится очистка и форматирование диска и при этом не все важные данные сохранены в безопасном месте.

Так или иначе все эти действия ведут к потере важной информации, что в свою очередь может грозить даже финансовыми потерями, так как с каждым годом стоимость данных становится все выше.

Если любая из этих ситуаций случилась с вами, и вы потеряли важны файлы – не спешите отчаиваться.

Лучше сразу же воспользуйтесь программой RS Partition Recovery – профессиональным инструментом для восстановления утерянных данных.

Программа очень удобна в использовании, что заметно выделяет ее среди конкурентов, и позволяет восстановить утерянный файл практически в несколько кликов мышки.

Но самое главное – это то, что RS Partition Recovery поддерживает ВСЕ современные файловые системы. Благодаря этому не имеют значения тип устройства (компьютер, сервер, смартфон) или тип файловой системы – вы все равно сможете восстановить важную информацию.

RS Partition Recovery поддержка всех современных файловых систем

Плюс еще одной очень полезной функцией RS Partition Recovery является режим глубокого сканирования накопителя. Благодаря ему вы сможете восстановить даже файлы, утерянные несколько месяцев тому назад.

Часто задаваемые вопросы

Diskpart это системная утилита Windows, которая предназначена для работы с дисками, подключенными непосредственно к компьютеру. Программа не имеет графического интерфейса и все манипуляции производятся при помощи командной строки или Windows PowerShell.

Чтобы удалить любой раздел с диска загрузитесь с загрузочного диска/флэшки и запустите командную строку. Затем по очереди выполните несколько команд (нажимая после каждой «Enter»): «diskpart», «list disk», «select disk 0», «list part», «select partition 2» (где «2» — это номер удаляемого раздела), «del par override». Больше деталей вы можете найти на нашем сайте.

RS Partition Recovery создана как раз для таких случаев и позволяет восстанавливать данные, которые были утеряны вследствие случайного форматирования раздела или диска, случайного удаления, повреждения файловой структуры диска и во многих других случаях.

Обычно такие разделы созданы специально. К примеру, Windows 10 создает дополнительный скрытый раздел размером 100 Мб, в котором хранится Recovery меню и другие дополнительные данные. Удаление таких разделов может нарушить работоспособность всей операционной системы.

Запустите командную строку и выполните несколько простых команд, нажимая после каждой «Enter»: «diskpart», «list disk», «select disk 0» (где «0» — это номер нужного диска), «select partition 1» («1» — это номер форматируемого раздела), «format fs=ntfs quick» Больше информации вы найдете на нашем сайте.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Нет изображения с веб камеры windows 10
  • The sleuth kit windows
  • Как запустить яндекс браузер в windows xp
  • Синхронизация громкости bluetooth windows 10
  • Как подключить сетевой диск в windows 10 по ftp