SPICE | VM Logical Disk Expansion Guide - UMCST/SPICE-user-info GitHub Wiki
Notes
-
To be safe, power off the Guest OS before performing the following steps. Only power the machine back up after everything that needs to be done on the hypervisor side has been done.
-
A logical disk expansion can only be performed on a Virtual Machine without existing snapshots, so ensure that all previous snapshots have been deleted. The steps to do so follow:
- Locate your VM in the Library menu on the left side of the panel
- Right click the VM and then mouse over to Snapshot > Snapshot Manager
- For each of the snapshots displayed in the manager, select them and then click the delete button located at the edge of the menu
- Repeat until there are no more snapshots and the origin-dot is directly pointing to the "You Are Here" target
-
Lastly, ensure that you follow the series of steps below that correspond with the OS that you are working with.
Expanding VM Disk in Settings
- Open up your hypervisor and log into the SPICE VMConsole.
- If you have any trouble doing so, refer back to the VMconsole Access and Use Guide
- Find your virtual machine by either moving down the Library hierarchy or by searching for it.
- Right-click the VM and mouse over to the "Settings" option.
- Once in the menu, you should be able to see the various components of the VM including the Hard Disk. Select this option.
- Mouse over to "Expand Disk..." and select it, then allocate the appropriate amount of disk space for the VM
- If this option is greyed-out, you likely still have some snapshots present on the machine, refer to the Notes section of this guide to learn about how to delete these.
- Ensure that the Hard Disk component of the VM reflects your change and then exit the menu. Power the VM back on.
- Follow the appropriate series of steps below in accordance with your VM's operating system.
Commands
Linux
- Add new disk space to partition
sudo cfdisk
- select the correct partition (probably sda3)
- select resize
- select write
- confirm write
- quit
sudo pvresize /dev/\<name of partition\>
(probably sda3)- Extend LVM (Command may differ if LVM configuration is not installer default which is unlikely)
- Ubuntu:
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
- Oracle Linux:
sudo lvextend -l +100%FREE /dev/ol/root
- Ubuntu:
- Resize FS
- Ubuntu:
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
- Oracle Linux:
sudo xfs_growfs /
- Ubuntu:
df -h
Windows
- Bring up run prompt with WinKey + R, type "diskmgmt.msc" and press enter
- Right-Click on primary volume (Likely C:) and select "Extend Volume..." option
- Bring up run prompt again with WinKey + R, type "compmgmt.msc" and press enter
- Right-Click "Disk Management" under "Storage" in the Computer Management Panel on the left side of the window
- Click "Rescan Disks"