This paper tells you how to partition a hard drive from command line prompt, such as resize/move partition without data loss, extend and shrink a volume. Besides, the command line supports to create, format, delete partitions and so on.
How to Use Qiling Disk Master Command Lines?
Qiling Disk Master Professional provides DiskMasterX.exe utility for users to partition hard drive from command prompt like Diskpart but more powerful. The DiskMasterX.exe command line utility enables you to perform most of the disk partition operations that are supported by the Qiling Disk Master graphical user interface (GUI).
You can resize/move/extend/shrink a partition without data loss from command prompt by using the DiskMasterX.exe command followed by various parameters. In addition, it also supports additional operations, such as create/delete/format a partition, rebuild MBR and more.
To use DiskMasterX.exe command line utility, click on the "Start" menu at the lower left corner. In the search box, type "cmd" or press "WIN + R" keys and type "cmd", and then run as administrator privilege. After that, Command Prompt will open. In the command window that opens type "cd + installation directory of Qiling Disk Master" to get started (e.g. cd C:\Program Files (x86)\Qiling Disk Master).
The followings are some features supported by Qiling Disk Master command line:
Export Execution Results to File
Because this command execution cannot use the ">" symbol to export execution results to file, so we specially add "/out" parameter for exporting execution results to file, which supports to export execution results of all command lines to file.
"/hd" followed by disk number, which starts with 0.
"/resize" followed by partition number or drive letter, and the partition number starts with 0. If the specified value is drive letter, disk number can be ignored.
The value of "/extend" can be left, right, auto or specified size.
"/align" means align a partition to optimize reading/writing speed. If the beginning of a partition is changed when resizing it (in other words, move the beginning of a partition to a new location, forward or backward), then the "/align" works. But if the beginning of a partition is not changed when resizing it, then the "/align" doesn't works.
By default, the specified size is in MB, and GB is also available.
Move a Partition without Data Loss
Parameters
Description
DiskMasterX.exe /hd:0 /move:0 /left:1000 /align
Change the location of a partition by moving 1000MB or 10GB to the left side and align the partition to optimize reading/writing speed.
DiskMasterX.exe /move:F /left:10GB /align
DiskMasterX.exe /hd:0 /move:0 /left:auto /align
Move a partition to occupy all unallocated space on its left side and align the partition to optimize reading/writing speed.
DiskMasterX.exe /move:F /left:auto /align
DiskMasterX.exe /hd:0 /move:0 /right:1000 /align
Change the location of a partition by moving 1000MB or 10GB to the right side and align the partition to optimize reading/writing speed.
DiskMasterX.exe /move:F /right:10GB /align
DiskMasterX.exe /hd:0 /move:0 /right:auto /align
Move a partition to occupy all unallocated space on its right side and align the partition to optimize reading/writing speed.
DiskMasterX.exe /move:F /right:auto /align
Notes:
"/hd" followed by disk number, which starts with 0.
"/move" followed by partition number or drive letter, and the partition number starts with 0. If the specified value is drive letter, disk number can be ignored.
The value of "/left" can be auto or specified size.
The value of "/right" can be auto or specified size.
"/align" means creating aligned partition to optimize reading/writing speed.
By default, the specified size is in MB, and GB is also available.
"/hd" followed by disk number, which starts with 0.
"/fmt" followed by partition number or drive letter, and the partition number starts with 0. If the specified value is drive letter, disk number can be ignored.
"/fs" means file system, whose value can be fat16, fat32 or ntfs.
Delete a Partition
Parameters
Description
DiskMasterX.exe /hd:0 /del:0
Delete a specified partition.
DiskMasterX.exe /del:F
DiskMasterX.exe /hd:0 /del:all
Delete all the partitions on a disk.
Hide/Unhide a Partition
Parameters
Description
DiskMasterX.exe /hd:0 /hide:0
Hide a specified partition.
DiskMasterX.exe /hide:F
DiskMasterX.exe /hd:0 /unhide:0
Unhide a specified partition.
Mark a Partition as Active
Parameters
Description
DiskMasterX.exe /setact:1 /hd:0
Set a specified partition as active.
DiskMasterX.exe /setact:F
Initialize a Disk
Parameters
Description
DiskMasterX.exe /init:1
Initialize a disk as MBR.
DiskMasterX.exe /init:1 /gpt
Initialize a disk as GPT.
Rebuild MBR
Parameters
Description
DiskMasterX.exe /rebuildmbr:0
Rebuild master boot record (MBR) for a hard disk, a removable disk or a USB flash drive.
DiskMasterX.exe /rebuildmbr:0 /mbrtype:0
DiskMasterX.exe /rebuildmbr:0 /mbrtype:1
DiskMasterX.exe /rebuildmbr:0 /mbrtype:2
Notes:
"/rebuildmbr" followed by disk number, which starts with 0.
"/mbrtype" supports a specified MBR type and its values are 0, 1, 2. The 0 means creating a Windows XP/2000/20003 MBR type. The 1 means creating a Windows Vista/2008 MBR type. The 2 means creating a Windows 7/8/8.1/10/2011/2012 MBR type.
If the value of /mbrtype is not specified, the default type is the one of current system. For example, if current system is Windows XP, then the value of "/mbrtype" is set as 0 by default; if current system is Windows 8.1, then the value of "/mbrtype" is set as 2 by default.
Change Drive Letter
Parameters
Description
DiskMasterX.exe /hd:0 /setletter:0 /letter:*
Remove drive letter.
DiskMasterX.exe /hd:0 /setletter:0 /letter:F
Change drive letter to F.
Notes:
"/hd" followed by disk number, "/setletter" followed by partition number, and the disk number and partition number always start with 0.
If a drive letter needs to be removed, you need to set "/letter" value as *
You had better not to remove and change the drive letter of system partition, which may cause Windows to fail to boot.
If you use "/letter auto" to replace "/letter:F", the drive letter will be assigned automatically.
Write Files to a Hidden Partition
Parameters
Description
DiskMasterX.exe /hd:0 /whide:0 /src:C:\file.txt
Write files and folders to the root directory of a hidden partition.
Before using the "/resize" and "/move" of Qiling Disk Master Command Line, we suggest you use Windows built-in chkdsk utility to check the partition you want to resize and automatically fix file system error so that the data safety can be ensured effectively. Example: chkdsk.exe /f C: