This paper provides a step-by-step guide on how to partition a hard drive from the command line, allowing users to resize, move, extend, and shrink volumes without losing any data. Additionally, it covers how to create, format, and delete partitions using command line prompts.
How to Use Qiling Disk Master Command Lines?
Qiling Disk Master Professional DiskMasterX.exe is a command line utility that allows users to partition their hard drive from the command prompt, offering more power than Diskpart. It enables users to perform most disk partition operations that are supported by the Qiling Disk Master GUI, providing a flexible and efficient way to manage disk partitions.
You can resize, move, extend, or shrink a partition without data loss from the command prompt using the DiskMasterX.exe command, which also supports additional operations like creating, deleting, or formatting a partition, as well as rebuilding the Master Boot Record (MBR).
To use DiskMasterX.exe, go to the Start menu, type "cmd" in the search box, and run it as administrator. In the Command Prompt, type "cd" followed by the installation directory of Qiling Disk Master (e.g. "cd C:\Program Files (x86)\Qiling Disk Master").
Here are some features of Qiling Disk Master command line in one paragraph:
Export Execution Results to File
Because this command execution cannot use the ">" symbol to export execution results to file, we add a "/out" parameter to export execution results to file, allowing all command lines to be exported to a file.
Use a partition manager tool to extend the specified partition by taking the unallocated space on its left side, and align it to optimize reading/writing speed.
DiskMasterX.exe /resize:F /extend:left /align
DiskMasterX.exe /hd:0 /resize:0 /extend:1000
Extend a partition by using 1000MB or 10GB of unallocated space on its right side.
To optimize reading/writing speed, shrink a specified partition to create 1000MB or 10GB of unallocated space on its left side and align the partition. This process involves resizing the partition to make space for a new drive or to improve performance by optimizing the partition's alignment.
"/hd" followed by disk number, which starts with 0.
The command "/resize" is used to resize a partition, and it requires a partition number or drive letter. The partition number starts with 0. If a drive letter is specified, the disk number can be ignored.
The value of "/extend" can be "left", "right", "auto", or a specified size.
"/align" in partition resizing means it optimizes reading/writing speed by adjusting the partition's start point when its size changes, but it's only effective when the start point is actually moved. If the start point remains the same, the optimization doesn't occur.
The specified size can be in either MB or GB, depending on the default setting.
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 and align it 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 it to optimize reading/writing speed.
DiskMasterX.exe /move:F /right:auto /align
Notes:
"/hd" followed by disk number, which starts with 0.
The command "/move" is used to move a partition or drive letter to a new location, and the partition number starts with 0. If the specified value is a drive letter, the 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.
The specified size can be in either MB or GB by default.
"/hd" followed by disk number, which starts with 0.
The format command "/fmt" is used to format a partition or drive, and it requires a partition number or drive letter. The partition number starts with 0. If the specified value is a drive letter, the disk number can be ignored.
"fs" in this context refers to the file system type, which can be one of the following: 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.
The "/mbrtype" option supports a specified MBR type, with values 0, 1, and 2, indicating the creation of MBR types for Windows XP/2000/2003, Windows Vista/2008, and Windows 7/8/8.1/10/2012/2013 respectively.
If the value of /mbrtype is not specified, the default type is the same as the current system, so if the system is Windows XP, the default is 0, and if it's Windows 8.1, the default is 2.
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:
The commands "/hd" followed by disk number, "/setletter" followed by partition number, and the disk number and partition number always start with 0.
To remove a drive letter, you need to set the "/letter" value to * in the Windows Registry.
I won't remove or change the drive letter of the system partition. I will keep it as it is to ensure Windows boots properly.
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" commands in Qiling Disk Master Command Line, it's recommended to run the Windows built-in chkdsk utility on the partition you want to resize, with the "/f" option to check and automatically fix any file system errors, ensuring data safety. For example, you can run "chkdsk.exe /f C:" on the C: drive.