簡體   English   中英

OpenStack中實例的分區

[英]partitioning of instance in OpenStack

我將vdi格式的虛擬盒映像上傳到OpenStack。 我為使用該.vdi映像創建的實例添加了100 G大小的樣式。 但是它仍然顯示在虛擬盒子中分配的15 G大小。 我不知道如何對磁盤進行分區以使用OpenStack風味提供的大小。

# 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大小?

分區和文件系統不會自動擴展。

提示:在您的問題中,您在分區 / dev / vda1上使用了fdisk而不是磁盤/ dev / vda。

如果要使用現有分區布局,則必須執行兩個步驟:

  1. 增加分區的大小。 互聯網上有許多文檔。 示例: Parted:將分區擴展到未使用的空間

  2. 增加文件系統的大小。 這里所需的命令取決於您的文件系統。 如果使用ext [234],則可以使用resize2fs /dev/vda1

或者,您可以在空白空間中創建一個新分區(例如,使用fdisk /dev/vda ,然后使用命令n代表new),在新分區上創建一個新文件系統並將其掛載-不要忘記添加它到/etc/fstab ,在下次啟動后會自動掛載。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM