Virtual machine 增加虚拟机的磁盘空间

Virtual machine 增加虚拟机的磁盘空间,virtual-machine,centos7,esxi,Virtual Machine,Centos7,Esxi,正如您在下面的命令中所看到的,我已经为我的虚拟机分配了总共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

正如您在下面的命令中所看到的,我已经为我的虚拟机分配了总共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

在VMWare中添加空间后,执行以下步骤以增加Linux磁盘:

  • 步骤1-更新分区表
  • fdisk/dev/sda

  • 步骤2-重新启动虚拟机

  • 步骤3-验证更改是否已保存

  • fdisk-l

  • 步骤4-将新分区转换为物理卷
  • 步骤5-扩展物理卷(centos是您的VG名称,如果不是,请使用您的VG名称代替centos)
  • vgextend centos/dev/sda3

  • 步骤6-扩展逻辑卷(500G是要添加的大小,如果不是,请使用正确的大小代替500G)
  • lvextend-L+500G/dev/mapper/centos root

  • 步骤7-联机扩展ext文件系统
  • 调整大小2FS/dev/mapper/centos root

    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.
    
    pvcreate /dev/sda3