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

  1. Increase disk size from Google console first
  2. SSH inside VM : sudo growpart /dev/sda 1
  3. Resize your file system : sudo resize2fs /dev/sda1
  4. 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:

  1. create a snapshot of your disk (Compute > Compute Engine > Snapshots);

  2. 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 ;

  3. 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;

  4. 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.