Resizing a disk image¶
Requirements:¶
Things that you will need¶
- SSH Connection to vhost
- virt-manager
Things of note¶
- Allways create a backup of the disk image before making changes to the disk image. It is always best practive to have a backup to prevent data loss.
Instructions:¶
Step 1. Connect to vhost¶
Connect to vhostStep 2. Scan the disks.¶
Scan the disks. You're looking for the virtual machine drive, check to make sure it is at or below 79%. If it is at 80% or above, stop.Step 3. Navigate to the directory your disks are mounted in.¶
Navigate to the directory your disks are mounted in.Step 4. View disk images¶
View disk imagesStep 5. View all VMs' status¶
View all VMs' status. Before continuing, ensure you are not interrupting the user's work.Step 6. Shutdown the VM gracefully¶
Shutdown the VM gracefully, if possible. Wait a minute or two.Step 7. Hard-shutdown of the VM¶
Hard-shutdown of the VM, if the graceful shutdown fails.Step 8. Resizes the disk image¶
Resizes the disk image. This could fail, seeIf there are snapshots
for more information.
If there are snapshots¶
If there are snapshots you will need to remove those before resizing.
Deleting snapshots 1.¶
Lists all snapshots of a VMDeleting snapshots 2.¶
Deletes the desired snapshotRe-run the command in step 8 after deleting the snapshots¶
Now that the disk image has been resized, we need to partion the drives inside the VM to match the new size.¶
Step 9. start the VM¶
Open virt-manager and start the VM
Step 10. Open Disk Manager¶
Log into the VM, click the windows icon and search for "Create and format hard disk partitions"
Step 11. Remove Windows recovery partition¶
If there is a recovery partition, you will need to delete it via the command line. Search for cmd.exe
, right-click it, and select Run As Administrator
. Run these commands:
diskpart
select disk 0
list partition
select partition <RECOVERY_PART_NUMBER>
delete partition override
exit
Step 12. Extend the Volume¶
Back in the graphical program, right-click the C: drive and click "extend volume."
Step 13. Setup Wizard¶
Follow the setup wizard.
VM has been resized
Last update:
2024-12-17