How To increase the size of a VHD or VHDX

How To increase the size of a VHD or VHDX  

Run the below commands is powershell

Shutdown the VM for which you wish to increase the disk space.

  1. Get-Command -Noun VHD* -Module Hyper-V    //This will show the commands that can be used over VHD

    1.  Now use below command to to resize

Resize-VHD -Path "" -SizeBytes

E.g. Resize-VHD -Path “G:\Hyper-V\21932.simulytics.com\Virtual Hard Disks\21932.new.simulytics.com_8A85FF6F-6D89-4E80-AD71-C483BAFC0C0D.avhdx” -SizeBytes 335GB

In above example command Changes the VHDX's size to 335GB

2. Start the VM.

3. Now it will start merging the disk as shown in below screenshot

The Resize-VHD cmdlet changes the maximum physical size of a virtual hard disk. It can expand both VHD and VHDX files but can shrink only VHDX files.

 

 


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 1035