Windows partition command line

Free Command Line Partition Manager for Windows 10/8/7

Learn how to use free command line partition manager which allows you to perform hard disk partitions management from command prompt. You can use command line utility to resize/move partitions in Windows 10/8.1/8/7 without data loss.

By AOMEI / Last Updated February 26, 2021

Do we really need a free command line partition manager?

To make all the things on your hard disk well organized, you will need a partition manager tool for flexibly partitioning, optimizing and managing your computer. No matter whether you want to partition your hard drive for Windows installation, allocate free disk space, resize partition, or change file system of a partition or partition table, you can use a Windows partition manager DiskPart.exe to deal with it.

We want to use command line. Although operating a command line interface more difficult than a GUI, for more efficient to handle multi-task, some users would use command line rather than open many windows. Users only need to execute a few lines of command by utilizing their keyboards to control over both the file and operating systems.

Compared with using GUI, using command line to operate takes much less resources of computer system. Additionally, some tasks can only be performed by using command line. For example, you cannot delete recovery partition with Disk Management for it prevents users inadvertently applying actions leading to data loss, but you can use diskpart to do it. Therefore, users may be looking for a command prompt partition manager.

How to use DiskPart in Windows 10/8/7?

You need to open an elevated command prompt. To do that, you can type “diskpart” in the Search box, and right-click on the result diskpart.exe and then select Run as administrator.

If you are not familiar with diskpart, you can type “help” to see all the available commands. For example, to extend system partition using DiskPart, you can use the commands below.

в—Џ List disk
в—Џ Select disk 0
в—Џ List partition
в—Џ Select partition 2
в—Џ Extend

Then all the unallocated space behind partition 2 will be added into partition 2. If there is no unallocated space behind it, then diskpart cannot extend partition. In that case, you can delete partition using DiskPart behind to generate unallocated space.

Diskpart can also help you convert MBR to GPT disk. To do that, you need to use DiskPart clean command to delete all partitions on the hard drive, and then type “convert gpt”. If you want to manage partitions in an easier way without data loss, you can use command line partition manager software.

Command line partition manager — AOMEI Partition Assistant

AOMEI Partition Assistant Professional is a very easy to use program providing both a solid graphical interface and command line utility. It allows users to partition hard drive from command prompt using partassist.exe utility, which can be regarded as Diskpart alternative. You need nothing but running a command in Powershell or Command Prompt to move/extend/shrink/resize a partition without losing data. What’s more, it is also capable of creating, deleting, formatting a partition, and rebuilding MBR. You can start it by running the command «cd + installation directory of AOMEI Partition Assistant» (e.g. cd C:\Program Files (x86)\AOMEI Partition Assistant Pro Edition 6.0). You can download the demo version firstly:

Читайте также:  Windows не удается завершит форматирование флешки

and click here to see all the parameters of partassist.exe command line utility.

More about AOMEI Partition Assistant

AOMEI Partition Assistant also comes with graphical user interface. It includes everything you need regarding file and disk management. With its user-friendly interface and step-by-step Wizards, one will know how to operate even for the first time to use it.

Besides the basic partition operations, it also allows you to transfer Windows 8/10 to a USB drive and it remains bootable, convert disk between MBR and GPT without data loss, make bootable media,Migrate OS with all the programs to SSD, and many more. You can free download this free command line partition manager software now.

diskpart

Applies to: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, and Windows Server 2008 R2, Windows Server 2008

The diskpart command interpreter helps you manage your computer’s drives (disks, partitions, volumes, or virtual hard disks).

Before you can use diskpart commands, you must first list, and then select an object to give it focus. After an object has focus, any diskpart commands that you type will act on that object.

List available objects

You can list the available objects and determine an object’s number or drive letter by using:

list disk — Displays all the disks on the computer.

list volume — Displays all the volumes on the computer.

list partition — Displays the partitions on the disk that has focus on the computer.

list vdisk — Displays all the virtual disks on the computer.

After you run the list commands, an asterisk (*) appears next to the object with focus.

Determine focus

When you select an object, the focus remains on that object until you select a different object. For example, if the focus is set on disk 0 and you select volume 8 on disk 2, the focus shifts from disk 0 to disk 2, volume 8.

Some commands automatically change the focus. For example, when you create a new partition, the focus automatically switches to the new partition.

You can only give focus to a partition on the selected disk. After a partition has focus, the related volume (if any) also has focus. After a volume has focus, the related disk and partition also have focus if the volume maps to a single specific partition. If this isn’t the case, focus on the disk and partition is lost.

Syntax

To start the diskpart command interpreter, at the command prompt type:

You must be in your local Administrators group, or a group with similar permissions, to run diskpart.

Parameters

You can run the following commands from the Diskpart command interpreter:

How to Manage Partitions with Disk Partition CMD in Windows 10?

«Unable to select a drive, as it is showing 0 MB while installing Windows 10, I tried to check-in cmd, but I don’t know its instructions. Can I get the cmd guide or other software?»
Are you confused about how to use disk partition cmd? Don’t worry. We know what you want to know. In the following, this page lists many practical tips about cmd. And we recommend a third party software — EaseUS Partition Master that can replace the cmd function.

Читайте также:  Ноутбук hp 15s fq2020ur установка windows

Content

Overview of disk partition cmd

Cmd, the abbreviation for command, is a Microsoft Windows command that opens the Windows command line window.
Notes: Windows 95 & 98 users can only enter the command line by entering command; other Windows users can enter command or cmd to use.

How to open Windows cmd

Method 1: You can input cmd in the Start Menu search bar to open the Windows Command Prompt.
Method 2: You can press Win+R to open the Run box, type cmd, and press Enter.

What is Diskpart

After open cmd, you need to type ‘diskpart’ for disk partitioning. Diskpart is a command-line utility in Windows 10, which enables you to operate disk partition by using Diskpart command prompt, including create, merge, extend, shrink, format, delete, wipe disk partition, and other features.

How to use disk partition cmd in Windows 10

Steps to create a partition in Windows 10 using command prompt.
Warning: Do not use the Diskpart until a full backup.

Step 1: You can use the two methods mentioned above to open the command prompt or Run window.
Step 2: Enter Diskpart
Steps about essential partition functions are as follows:

  • Create a partition using Diskpart

1. At the Diskpart prompt, type: List DiskВ
2. Input: Select Disk * (* represents the disk number)
3. Type: Create partition primary size=*(* means the partition size.)В
4. Input: Assign letter=* (* represents Choose a drive letter not already being used.)
5. Type: Exit (Exit is the Esc on the top left of the keyboard.)

  • Extending a partition using Diskpart

Note: If you try it or any other method, make sure you have a full backup.
1. Verify that contiguous free space is available on the same drive and that free space is next to the partition you intend on extending, with no partitions in between.
2. Type: Select Disk * (Selects the disk.)
3. Type: Select Volume *(Selects the volume.)
4. Type: Extend Size=*
5. Type: Exit

  • Deleting a partition using Diskpart

Note: You cannot delete an active system or boot partition or a partition with a dynamic page file.
1. Input: Diskpart.exe
2. Select disk *
3. Select Partition *
4. Delete partition
5. Exit

  • Wiping a disk using Diskpart

This operation deletes all data on the disk.
1. Type: Select disk *
2. Type: Clean all(The CLEAN ALL command removes all partition and volume information from the hard drive being focused on.)
3. Exit
The diskpart also has other features, such as assign drive letters, shrink partition, mark partition as active, convert MBR/GPT. If you want to learn these parts, FAQ, at the end of the article, will bring you the right answer.
After reading the above guide, I believe you have a specific understanding of how to use cmd via Diskpart in Windows 10. Cmd is a powerful tool, but it is not suitable for a beginner. Misoperations can easily cause partition problems. There is a better software — EaseUS Partition Master.

How to manage partitions with EaseUS Partition Master

EaseUS Partition Master is an all-in-one partition manager, whichВ helps you create, resize, clone, move, merge, and format partitions. The following video tutorial shows you how to create, deleted, shrink, and resize a partition with this powerful disk management program.

Favored by millions of users. It contains all features Diskpart has and many other superior functions like the two demonstrated below.В

1. Disk migration and cloning
Nowadays, for better performance of computer disk, you may want to migrate the operating system and clone disk to the target one. It saves the user’s time to download programs. It only takes a few steps to get remarkable results. For example, there is a guide about «transfer Windows 10 to a new hard drive(HDD/SSD)».

Читайте также:  Вы не можете сохранить параметры windows личные файлы

Steps to migrate OS to HDD/SSD:

  • Run EaseUS Partition Master, select Migrate OSВ from the top menu.
  • Select the SSD or HDD as the destination disk and click Next.
  • Check Warning: the data and partitions on the target disk will be deleted. Make sure that you’ve backed up important data in advance. If not, do it now.
  • Then click Continue.

  • Preview the layout of your target disk.В Then click Proceed to start migrating your OS to a new disk

Note: The operation of migrating OS to SSD or HDD will delete and remove existing partitions and data on your target disk when there is not enough unallocated space on the target disk. If you saved important data there, back up them to an external hard drive in advance.

2. Partition Recovery
Partition Recovery is a practical feature targeting your lost partitions.
It is worth trying to scan your selected disk. The spending time of a deep scan may in line with your disk volume.
You can check the related article about «recover unallocated space in Windows 10» to get further learning.

Step 1. Open EaseUS Partition Master and click «Partition Recovery» on the top menu. A new window will pop up and ask you to select a disk to start searching for lost partition(s). So choose the desired disk and click «Scan«.

Step 2.В A quick scan will immediately start. You can pause the scanning process by clicking «Proceed» at any timeВ when the lost partition shows up to start recovery.

You can also double click on the partition you’re looking for to preview content.

Step 3. As soon as the lost partition and data has been found, click «Recover Now«. Or else, go on with «Continue Scanning» for more lost data recovery.

Step 4. After the recovery process, click «Finish«. Your lost partition should reappear in your drive.

1. How do I use diskpart command in Windows 10?
-Boot into Windows 10
-Press the Windows key and C to open the charm bar.
-Type cmd
-Click Command Prompt
-When Command Prompt opens, type diskpart
-Press Enter

2. How to assign drive letter via Diskpart?
—Type «assign letter=F» (F can be replaced with another letter that has not been used yet).
—And then, you will receive a message that says: DiskPart successfully assigned the drive letter or mount point.

3. How to shrink partition via Diskpart
Type shrink directly will automatically shrink the partition by Windows, and you can also type shrink desired=*** to define your partition size.
(Such as: Type «shrink desired=10240». And then, you will receive a message that says: DiskPart successfully shrunk the volume by 10GB.)
Note: You can reduce the size of a volume only if it is formatted using the NTFS file system.

4. How to mark a partition as active via Diskpart?
—Type active.
—And then, you will receive a message that says: DiskPart marked the current separation as active.

5. How to clean Disk/convert a disk to GPT/ convert a disk to MBR?
-Type: list disk.
-Type: select disk 1.
-Type: clean.
-Type: convert gpt or convert mbr.

Оцените статью