Updating existing disk size on google cloud
Now you can increase size of a Persistent Disk in place (beta feature):
gcloud beta compute disks resize DISK_NAME [DISK_NAME …] --size SIZE [--zone ZONE]
It works even of disk is attached and being used. This would only re-size physical device. file system (and possibly partitions still need to adjusted after that)
https://cloud.google.com/sdk/gcloud/reference/beta/compute/disks/resize
Update disk size on the fly without restarts
- Increase disk size from Google console first
- SSH inside VM :
sudo growpart /dev/sda 1
- Resize your file system :
sudo resize2fs /dev/sda1
- Verify :
df -h
I managed to replicate your issue and there is a workaround for this. Basically what you need to do is snapshot your disk, increase it, create a new instance with the new size.
From the Google Developers Console:
create a snapshot of your disk (Compute > Compute Engine > Snapshots);
create a new disk : Compute > Compute Engine > Disks - new disk , select from snapshot in step 1 > below that you can specify the new size in GB ;
create a new VM instance and choose Existing Disk (make sure the disk is in the same zone as the instance you are creating) and select the disk one from step 2;
SSH to your instance and follow steps 4-13 from Repartitioning a root persistent disk.
You should now have an exact replica of your previous machine, but with a bigger HDD. Let me know if you see any issues.