Extend Volume in Windows


Extend Volume in Windows.
Two methods will be covered here. PowerShell and DiskPart

PowerShell

In this example a C:\ partition will be extended by 1 GB on a 100 GB disk .

  • System Reserved 549 MB
  • C: 99.46 GB


The Resize-Partition cmdlet will be used. It requires Size argument that is less than or equal to the LargestFreeExtent
To work out how much free space is available to the partition.
Disk:Size – Disk:AllocatedSize = LargestFreeExtent.
Or use the Get-PartitionSupportedSize cmdlet.

Get-Disk | Select-Object -Property Number,PartitionStyle,AllocatedSize,Size,LargestFreeExtent
Number : 0
PartitionStyle : MBR
AllocatedSize : 107374182400
Size : 108447924224
LargestFreeExtent : 1073741824
Get-Partition -DiskNumber 0
PartitionNumber DriveLetter Offset Size Type
--------------- ----------- ------ ---- ----
1 1048576 549 MB IFS
2 C 576716800 99.46 GB IFS
 Get-PartitionSupportedSize -DriveLetter C
SizeMin SizeMax
------- -------
27401424896 107870158848
Resize-Partition -DriveLetter C -Size 107870158848

or

Resize-Partition -DriveLetter C -Size 100.4619140625GB
Get-Disk | Select-Object -Property Number,PartitionStyle,AllocatedSize,Size,LargestFreeExtent
Number : 0
PartitionStyle : MBR
AllocatedSize : 108447924224
Size : 108447924224
LargestFreeExtent : 0

DiskPart

Open an administrative CDM or PowerShell Terminal.

diskpart
Microsoft DiskPart version 99.9.19041.9
Copyright (C) Microsoft Corporation.
On computer: test
list disk
Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
Disk 0 Online 32 GB 1024 MB
list volume
Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 D  UDF DVD-ROM 950 MB Healthy
Volume 1 System Rese NTFS Partition 549 MB Healthy System
Volume 2 C NTFS Partition 32 GB Healthy Boot
select volume 2
Volume 2 is the selected volume.
extend size=1024
DiskPart successfully extended the volume.
exit
Leaving DiskPart…
exit
  • https://docs.microsoft.com/en-us/windows-server/storage/disk-management/overview-of-disk-management