Can't get the boot disk to 200GB [closed]

廉价感情. 提交于 2019-12-14 03:26:54

问题


I tried creating the disk first via gcutil adddisk and then assigning it to the VM when running gcutil addinstance with the --disk flag. However, this method still results in a 10GB partition even though I set it to 200GB on adddisk.

Here is the disk itself:

INFO: Zone for db2-usc1a detected as us-central1-a.
+-----------------+--------------------------------------------------------+
| name            | db2-usc1a                                              |
| description     |                                                        |
| creation-time   | 2014-06-11T22:45:39.654-07:00                          |
| zone            | us-central1-a                                          |
| status          | READY                                                  |
| source-snapshot |                                                        |
| source-image    | projects/centos-cloud/global/images/centos-6-v20140606 |
| source-image-id | 6290630306542078308                                    |
| size-gb         | 200                                                    |
+-----------------+--------------------------------------------------------+

But, as you can see, running df -h displays it as 9.9GB:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1       9.9G  4.3G  5.1G  46% /
tmpfs           7.3G     0  7.3G   0% /dev/shm

I have also tried to follow these instructions here: https://developers.google.com/compute/docs/disks#repartitionrootpd

However, on reboot, the VM becomes inaccessible so I can't even SSH back onto the machine.

Why is Google enforcing a 10GB image on boot? Why is it not being set to the size I have requested? More importantly, is there a way I can automate this process for our build scripts?


回答1:


One option is to use Persistent Disk Snapshots:

  • resize the disk
  • create a snapshot of the disk
  • in your build scripts, create new PDs from your snapshot instead of the default image

The new disks will be 200GB. Snapshots only save blocks which have changed, so the snapshot itself should be fairly small.




回答2:


As the previous comment suggests, resize the disk. For those who don't know how to do this:

sudo /sbin/resize2fs /dev/sda1


来源:https://stackoverflow.com/questions/24468139/cant-get-the-boot-disk-to-200gb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!