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.
相关问题
- Why do Dataflow steps not start?
- __call__() missing 1 required positional argument:
- Cannot upload large file to Google Cloud Storage
- How to set query parameters dialogflow php sdk
- Google Data Studio connect to cloud datastore
相关文章
- How do I create a persistent volume claim with Rea
- GKE does not scale to/from 0 when autoscaling enab
- Can't push image to google container registry
- Your application has authenticated using end user
-
Google App Engine Error:
INVALID_ARGUMENT - How to create a namespace if it doesn't exists
- How can I make http call to DialogFlow V2 using si
- Kafka to Google Cloud Platform Dataflow ingestion
Since the new GCoud command line tool you can choose your boot disk size and type at the instance creation:
Then resize the root partition using these instructions: https://cloud.google.com/compute/docs/disks#repartitionrootpd
Documentation : https://cloud.google.com/sdk/gcloud/reference/compute/instances/create
Edit: After resizing the root partition, you have to reboot your instance to force the system to re-read the partition table. That makes this trick unusable in a startup script (executed on each startup/reboot).
I know this is an old topic, but I just did this using a simpler method than the ones explained above. All from the cloud console user interface with no need to worry or do any special commands in just a few minutes and clicks.
However, it requires creating a new instance, not resizing a disk on an already running instance
Create a snapshot of the disk you want to enlarge
Create a new instance from the snapshot and specify the new size
This is a fool-proof way to enlarge a disk without causing any partition errors, doesn't require any commands or special actions.
The only downside is that you need to create a new instance. You can't just do it on an instance that you already have.
Alternatively, in GCP you can use the gcp console to resize the partition and filesystem to use the extra space that is available.
Grow the partition.
Note that there is space between sda and 1.
Grow the file system in the partition:
Note that
sda1
is the device name. The name could be different in your case. You can check this by usinglsblk
ordf -h
commands.Now you can resize a Persistent Disk in place:
This would only re-size physical device. file system (and possibly partitions still need to be adjusted after that)
This is more like a follow-up to @user1130176's answer, but if you are running CentOS 7+, you'll need to do the following for step #4 (expanding the filesystem):
xfs_growfs /dev/sda1
The new disks on CentOS 7 are of type
xfs
. Hope this helps, it was not very clear from all the links around.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:
Or via CLI:
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
orxfs_growfs
, so it should be sufficient to just resize the disk and reboot the VM for changes to take effect.