Search code examples
cloudgoogle-compute-engine

Updating existing disk size on google cloud


I have disk of space 10G in google cloud with name disk1.

Root persistent disk has already occupied around 4 to 5 GB and remaining 5 GB is occupied by other programs ,so it is almost full to 10GB .MY case is I can not add other disk ,i have to work on same disk.

I want to increase this disk size from 10 GB to 20 GB,In https://cloud.google.com/compute/docs/disks#repartitionrootpd i can not see way of increasing size of existing disk in my case increasing size of disk1 to 20GB Is it possible to update existing disk size ?


Solution

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