Default images have 10GB, but I need more (30GB approx). If I create a disk of 30GB using one of that default images, the usable space it's 10GB, not 30GB. I know I can install the distro using tools like debootstrap, but that seems unnecessarily complicated. is there any other way to do it?
This may be a new feature as of this writing, but go to
So, one approach to answering your question is to create an instance with the default disk and simply resize it via the Compute Engine GUI.
You can create a boot disk larger than 10GB but then you'll need to repartition it, because by default, the provided VM images expand to 10GB so you'll need to use these instructions and run fdisk
, reboot, and then run resize2fs
to expand the usable space to the full size of the disk. You can automate it so that it runs as part of instance creation by using startup scripts.
Edit 1: I have open-sourced my scripts which do this for you automatically at boot using the startup-script
metadata. You can find sample code in my GitHub repo created specifically for this question, which has been verified to work with CentOS and Debian. See fdisk.sh
for the repartitioning and gcloud.sh
for the deployment commands.
Edit 2: Alternatively, you can also create an additional disk and attach it to your instance but you'll also need to format and mount it before you can use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With