Google Cloud Platform Increase Boot Disk on Virtual Machine
Hope this article help to Increase Boot Disk on Virtual Machine GCP.
Solution
Should be increase boot size and not work if you want to downgrade boot size
Resize the Disk in GCP Console:
Go To Cloud Shell, then write this
DISK_NAME = "Test"
ZONE_NAME = "example-asia"
SIZE_INCREASE = "50GB"
gcloud compute disks resize DISK_NAME --size SIZE_INCREASE --zone ZONE_NAME
Connect to your SSH
YOUR_VM_INSTANCE_NAME = "TEST VM"
gcloud compute ssh YOUR_VM_INSTANCE_NAME
Open Parted
sudo parted /dev/sda
Print parted
Resize the Partition
resizepart 1 100%
Exit Parted
quit
Resize the Filesystem (for ext4 work on linux ubuntu)
sudo resize2fs /dev/sda1
Update /etc/fstab
sudo blkid
Edit fstab
sudo nano /etc/fstab
Option 1 : using UUID
UUID=your-root-uuid / ext4 defaults 0 1
Option 2 : using LABEL
LABEL=your-label / ext4 defaults 0 1
Test Configuration
sudo mount -a
Reboot System
sudo reboot
Check Disk after reboot
df -h