Expand disks using Diskpart
From Tech-Wiki
More actions
Extend a Windows volume with DiskPart, including the recovery-partition scenario where free space is not immediately adjacent to the target volume.
Disk and partition operations can destroy data
Confirm the selected disk, volume and recovery partition before using
extend, delete partition override or changing partition identifiers. Take an appropriate backup first.Extend a volume
The original example extends the selected volume by 10 GB. If no size is specified, DiskPart uses the available adjacent space.
DISKPART > list disk
DISKPART > select Disk 0
DISKPART > detail Disk
DISKPART > select Volume 1
DISKPART > extend Size=10000
DISKPART > ExitWhen the recovery partition blocks the free space
Disable Windows Recovery Environment:
Disable WinRE
reagentc /disable
Use DiskPart to remove the recovery partition:
DISKPART > list disk
DISKPART > select disk #
DISKPART > list partition
DISKPART > select partition 4
DISKPART > delete partition overrideExpand the required Windows volume while leaving approximately 1 GB free at the end of the disk for the recovery partition.
Create a new NTFS recovery volume without assigning a drive letter.
Restore the recovery-partition attributes
Select the newly created recovery partition:
DISKPART > list partition
DISKPART > select partition 4For GPT disks:
DISKPART > set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
DISKPART > gpt attributes=0x8000000000000001For MBR disks:
Set the recovery partition type
set id=27
Re-enable Windows Recovery Environment:
Enable WinRE
reagentc /enable