如下面的命令所示,我已为我的VM分配了总共500 GB的磁盘空间。但是我看到磁盘上有14.4 GB的实际空间,一旦磁盘完全用完。我收到一个错误,没有太多可用空间?如何为 / dev / mapper / centos-root 扩展空间。
我正在使用VMware ESXi并为此虚拟机使用centOS。
[root@localhost Apr]# fdisk -l
Disk /dev/sda: 536.9 GB, 536870912000 bytes, 1048576000 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 label type: dos
Disk identifier: 0x00064efd
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 33554431 15727616 8e Linux LVM
Disk /dev/mapper/centos-root: 14.4 GB, 14382268416 bytes, 28090368 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 /dev/mapper/centos-swap: 1719 MB, 1719664640 bytes, 3358720 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 byte
答案 0 :(得分:0)
在 VMWare 中添加空间后,执行以下步骤以增加 Linux 磁盘:
fdisk /dev/sda
Press p to print the partition table to identify the number of partitions.
Press n to create a new primary partition.
Press p for primary.
Press 3 for the partition number, depending on the output of the partition table print.
Press Enter two times.
Press t to change the system's partition ID.
Press 3 to select the newly creation partition.
Type 8e to change the Hex Code of the partition for Linux LVM.
Press w to write the changes to the partition table.
第 2 步 - 重新启动虚拟机。
第 3 步 - 验证更改是否已保存
fdisk -l
pvcreate /dev/sda3
vgextend centos /dev/sda3
lvextend -L+500G /dev/mapper/centos-root
resize2fs /dev/mapper/centos-root