Extend Disk Space without shutdown
We have a sever for code test, but with the test case growth, the Disk space is not enough for use.
Fortunately, we use ubuntu LVM to manage the Disk.
1fdisk /dev/sdb
1pvdisplay
https://gyazo.com/40b3c078d6bb755f9cca318b3c28b2cf
1vgextend ubuntu-vg /dev/sdc1
1vgdisplay
1lvdisplay
1lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
2resize2fs /dev/ubuntu-vg/ubuntu-lv
Multipass extend VM disk size.
Multipass uses qemu to create the VM instance. So you can modify the qemu image manually to change the VM disk size.
- Stop the VM
1multipass stop vm-name
- Find the VM image
1/var/snap/multipass/common/data/multipassd/vault/instances
- Expand the size of the image
1qemu-img resize xxx.img 200G
2# qemu-img resize xxx.img +100G
- Restart the VM
1multipass start vm-name