无法将启动磁盘获取到200GB [英] Can't get the boot disk to 200GB

查看:99
本文介绍了无法将启动磁盘获取到200GB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试先通过gcutil adddisk创建磁盘,然后在运行带有--disk标志的gcutil addinstance时将其分配给VM.但是,即使我在adddisk上将其设置为200GB,该方法仍会导致10GB分区.

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.

这是磁盘本身:

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                                                    |
+-----------------+--------------------------------------------------------+

但是,如您所见,运行df -h会将其显示为9.9GB:

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

我也尝试按照以下说明进行操作: https://developers.google. com/compute/docs/disks#repartitionrootpd

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

但是,重新启动后,虚拟机变得不可访问,因此我什至无法通过SSH重新登录到计算机.

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

为什么Google会在启动时强制执行10GB的映像?为什么未将其设置为我要求的尺寸?更重要的是,有没有办法使我们的构建脚本自动化此过程?

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?

推荐答案

一种选择是使用永久磁盘快照:

  • 调整磁盘大小
  • 创建磁盘快照
  • 在构建脚本中,从快照而不是默认映像中创建新的PD

新磁盘将为200GB.快照仅保存已更改的块,因此快照本身应很小.

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

这篇关于无法将启动磁盘获取到200GB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆