Maybe it’s obvious in hindsight but you can’t just update the disk size through the dashboard. Well technically you can but there’s a bit more work to be done before it’s reflected in your VM. Just follow the steps.
Let’s 🚀
In Cloud Console
Goto Compute Engine > Disks > Edit
- Update to a different size and save
- I’m resizing mine from 10GB to 50GB
In the VM shell
1. Resize the partition
sudo parted /dev/sdaprintresizepartPartition number? 3End? 100%quit
2. Get PV information
# Note the PV_NAME and Logical volumesudo pvdisplay -m
3. Resize physical volume
# sudo pvresize PV_NAMEsudo pvresize /dev/sda3
4. Resize Logical volume
# sudo lvresize Logical volumesudo lvresize /dev/ubuntu-vg/ubuntu-lv -L +40g
5. Expand fs to use the space
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lvdf -h
Voilà, my disk is now utilising all the extra space I allocated through the Cloud Console earlier.