OpenStack中实例的分区 [英] partitioning of instance in OpenStack
问题描述
我将vdi格式的虚拟盒映像上传到OpenStack.我为使用该.vdi映像创建的实例添加了100 G大小的样式.但是它仍然显示在虚拟盒子中分配的15 G大小.我不知道如何对磁盘进行分区以使用OpenStack风味提供的大小.
I uploaded a virtual box image in vdi format to OpenStack. I added a flavor of 100 G size to the instance created using that .vdi image. But it still showing the 15 G size allocated in virtual box. I dont know how to partition the disk to use the size provided by the OpenStack flavor.
# df -h
如下
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 15G 4,4G 9,3G 32% /
none 4,0K 0 4,0K 0% /sys/fs/cgroup
udev 2,0G 4,0K 2,0G 1% /dev
tmpfs 396M 824K 395M 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 2,0G 144K 2,0G 1% /run/shm
none 100M 40K 100M 1% /run/user
还有
# fdisk /dev/vda1
如下
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xe682a7ff.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): p
Disk /dev/vda1: 15.8 GB, 15793651712 bytes
16 heads, 63 sectors/track, 30602 cylinders, total 30846976 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe682a7ff
Device Boot Start End Blocks Id System
Command (m for help):
我如何对虚拟机磁盘进行分区以获取整个100 Gb大小?
How I need to partition the Virtual machine disk to get the entire 100 Gb size??
推荐答案
分区和文件系统不会自动扩展.
The partition and filesystem is not extended automatically.
提示:在您的问题中,您在分区/dev/vda1上使用了fdisk,而不是磁盘/dev/vda.
Hint: in your question you use fdisk on the partition /dev/vda1 instead of the disk /dev/vda.
如果要使用现有的分区布局,则必须执行两个步骤:
You have to do two steps if you want to use the existing partition layout:
-
增加分区的大小.互联网上有许多文档.例如:已分区:将分区扩展到未使用的空间.
增加文件系统的大小.这里所需的命令取决于您的文件系统.如果使用ext [234],则可以使用resize2fs /dev/vda1
.
Increase the size of the filesystem. The command that is needed here depends on your filesystem. If you are using ext[234] you can use resize2fs /dev/vda1
.
作为替代方案,您可以在空白区域中创建一个新分区(例如,使用fdisk /dev/vda
,然后使用命令n
来表示新分区),在新分区上创建一个新文件系统并将其挂载-不要忘记将其添加到在下次启动后自动挂载的/etc/fstab
中.
As an alternative you can create a new partition in the empty space (using e.g. fdisk /dev/vda
and then the command n
for new), create a new file system on the new partition and mount it - don't forget to add it to /etc/fstab
that is gets mounted automatically after the next boot.
这篇关于OpenStack中实例的分区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!