The root disk size in GCE is 10 gigs. How do I increase this? I cant find the option in the console or the gcutil flags. This can be easily done in AWS.
As of 31 Mar 2016, you can resize a persistent disk online without stopping or rebooting the VM, without taking snapshots, and without having to restore it to a larger disk.
The blog post announcing the feature has the details, and you can see the docs for how to do this via the console:
Resize the persistent disk in the Google Cloud Platform Console:
- Go to the Compute Engine page.
- Click on "Disks" in the sidebar
- Click the name of the disk that you want to resize.
- At the top of the disk details page, click "Edit".
- In the "Size" field, enter the new size for your disk.
- At the bottom of the disk details page, click "Save" to apply your changes to the disk.
- After you resize the disk, you must resize the disk partitions so that the operating system can access the additional space.
Or via CLI:
gcloud compute disks resize example-disk --size 250
Then, on Debian/Ubuntu/etc. run:
$ sudo apt install -y cloud-utils # Debian jessie
$ sudo apt install -y cloud-guest-utils # Debian stretch, Ubuntu
$ sudo growpart /dev/sda 1
$ sudo resize2fs /dev/sda1
or, for RedHat/Fedora/CentOS/etc.:
$ sudo dnf install -y cloud-utils-growpart
$ sudo growpart /dev/sda 1
$ sudo xfs_growfs -d / # CentOS 6 needs `resize2fs`
Note that some operating systems will automatically resize your partition on reboot without requiring you to do any manual steps with tools such as fdisk
, resize2fs
or xfs_growfs
, so it should be sufficient to just resize the disk and reboot the VM for changes to take effect.