The following process changes the VHD file size using the power shell (run
as administrator).
- mount-vhd <vhdname> –passthru | get-disk | get-partition |
get-volume
- This
will mount the virtual hard disk in the management operating system, and
let you know the drive letter that was assigned to it.
- Ex: mount-vhd
F:\MYVHD.vhdx –passthru | get-disk | get-partition | get-volume
- resize-partition –driveletter <driveletter> –size
<newsize>
- This
will resize the partition inside the virtual hard disk.
- Ex: resize-partition
–driveletter I –size 60GB
- dismount-vhd <vhdname>
- Dismount
the virtual hard disk after shrinking the partition.
- EX: dismount-vhd
F:\MYVHD.vhdx
- resize-vhd <vhdname> –ToMinimumSize
- Now shrink the virtual hard disk to match the new size
- EX: resize-vhd
F:\MYVHD.vhdx –ToMinimumSize
No comments:
Post a Comment