Skip to content

Instantly share code, notes, and snippets.

@prashant-shahi
Created March 4, 2019 08:02
Show Gist options
  • Save prashant-shahi/fa260a67d7404338dc34854d0f580858 to your computer and use it in GitHub Desktop.
Save prashant-shahi/fa260a67d7404338dc34854d0f580858 to your computer and use it in GitHub Desktop.
Increase or Decrease size of Virtual Machine (VM) in Google Cloud

Follow the steps to increase or decrease the size of VM in Google Cloud :

  1. Goto https://console.cloud.google.com
  2. Goto Compute Engine tab, followed by VM Instances.
  3. Select the VM for which you want to increase/decrease the disk size.
  4. Under Boot disk, you will see one(or more) disks for the VM. Click on one for which you desire to update disk size.
  5. Click Edit in the top. Then, modify the Size. At last, click on save.
  6. Now, we just need to tell the OS to grow the partition to the total size. This can be done by executing following commands :
fdisk -l
growpart /dev/sda 1
resize2fs /dev/sda1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment