Hyper-V Virtual Disk Operations: Compact, Convert, Expand, and Shrink – How to Guide and Tips.
Compact
1. 运行你的 Hyper-V 管理器 并点击 Edit Disk;
2. 点击 下一个;
3. 点击 浏览 to select your disk for operations;
4. After Disk is selected click 下一个;
5. First option is Compact (this is the simplest operation). 点击 下一个;
6. At the next page click 下一个;
Convert
1. Option Convert (change your Virtual Disk format, *.vhd or *.vhdx). 点击 下一个;
2. Select the format and click 下一个;
3. Select the type of Virtual Disk.
笔记: In enterprise is Best Practice – to use a Virtual Disk type Fixed size.
4. Make a choice and click 下一个;
5. 点击 浏览 to select the final name and destination of Virtual Disk, 然后单击 节省;
7. If it’s ok – click 下一个;
8. 点击 结束 to run this operation;
Expand
1. Run Hyper-V Manager and click on Inspect Disk and select target 虚拟磁盘 to show information about it. 点击 关闭 按钮;
2. We have 60 GB VHDX, Expand it. Click on Edit Disk in Hyper-V Manager; 点击 下一个 按钮;
3. 点击 the Browse button and select target 虚拟磁盘;
4. After selecting click the 下一个 按钮;
5. 选择 Expand option and click the 下一个 按钮;
6. Enter the new size and click the Next button, I’m set to 80 国标. (You must have free space to do this);
7. Check the final information and click the 结束 按钮;
8. Let’s Inspect Disk 再次. As we see – it now 80 GB size.
9. Connect to VM, which Virtual Disk we Expand. Login in (user must have Local Administrator Rights) and open This PC;
10. As we see it’s 60 国标 (old size) but not 80 国标. 关闭 This PC. 鼠标右键 点击 开始 按钮并选择 Disk Management;
11. After the Disk Management console opens you will see Unallocated space on the Disk (20 国标);
12. 鼠标右键 click on Disk “(C:)” and select Extend Volume;
13. 点击 下一个 按钮;
14. It shows up space for extending. 点击 下一个 按钮;
15. 点击 结束 to apply changes;
16. As we see – The disk is extended to 80 国标, close the Disk Management 安慰;
17. Open “This PC 再次. Hooray “Local Disk (C:)” now has an 80 GB size.
Shrink
1. Run Hyper-V Manager and make sure your 虚拟机 (虚拟机) with target “虚拟磁盘 is in an 离开 state. Close Hyper-V Manager;
2. 打开 Disk Management on the Hyper-V computer (local pc). 鼠标右键 点击 开始 按钮并选择 Disk Management;
3. 后 the Disk Management console opens, go to the upper menu. 点击 行动 and then Attach VHD;
4. 点击 浏览 to select the target 虚拟磁盘 文件;
5. After selecting click the 好的 按钮;
6. We connected 虚拟磁盘;
7. 鼠标右键 click on the connected Disk and select Shrink Volume;
8. Enter the size in MB (Megabytes) to shrink from Disk. 点击 Shrink 按钮;
9. 完美的, shrinking is successful;
10. 鼠标右键 click on your 虚拟磁盘 并选择 Detach VHD;
11. 点击 好的 and close the Disk Management 安慰;
12. Run your Hyper-V Manager and click on Edit Disk;
13. 点击 下一个 按钮;
14. 点击 浏览 button to select target 虚拟磁盘;
15. After selecting Disk click the 下一个 按钮;
16. As you see we get a new option Shrink, select it and click the 下一个 按钮;
笔记: Option “Shrink” is available if “虚拟磁盘” has “Unallocated” space.
17. Enter the new size and click the 结束 按钮;
18. Inspect our 虚拟磁盘 再次, now it’s 41 国标;
19. In the system;