VMware Knowledge Base参考链接 VMware Knowledge Base
1. 删除之前的snapshots 在扩容过程中都不能有snapshots 因此如有需要请提前备份
Actions -> Snapshots -> Manage Snapshots -> DELETE ALL
2. 服务器关机
关机命令:
- halt:立刻关机
- poweroff:立刻关机
- shutdown -h now:立刻关机(root用户使用)
- shutdown -h 10:10分钟后自动关机
3. 增加服务器硬盘容量
关机后cpu和memory从灰色变为可修改
如果 硬盘显示灰色说明有snapshots 未删除
4. 更改后 重启 服务器
5. 打开终端 用ssh 命令 登录 root 用户
6.执行 df -h 查看磁盘空间
7. sudo fdisk -l
8. sudo fdisk /dev/sda
- Type
n
to create a new partition. - Choose the primary partition type.
- Choose the default partition size to use the whole disk.
- Type
t
to change the partition type. - Choose the partition number of the new partition.
- Type
8e
to set the partition type to Linux LVM. - Type
p
to print the partition table and make sure it looks correct. - Type
w
to save the changes and exit.
9. sudo pvcreate /dev/sdX1
/dev/sdX1 with the name of the new partition. for example: sda4
10. sudo lvextend -r -l +100%FREE /dev/mapper/VG-lv_root
11. df -h /
12. take snapshot again
参考链接
virtual machines - Insufficient free space: X extents needed, but only Y available - Server Fault
Linux磁盘扩容三种方式_Hlroliu的博客-CSDN博客_linux磁盘扩容
lvextend /dev/vg_webserver/lv_root -l+100%FREE
要求系统分配所有闲置空间到选择的逻辑分区
The above command will ask the system to allocate all free space to the selected logical volume, without asking for a specific size.
7.ext4格式磁盘使用resize2fs /根目录
xfs_grofs /根目录
8. df -h 检查磁盘空间 重启服务器服务 重新制作snapshot
报错参考
vCSA警报,磁盘空间不足,解决一例。_u014461454的博客-CSDN博客
创建物理卷报错Can‘t open /dev/sdb1 exclusively. Mounted filesystem?以及对应的解决方法_Kevin古月的博客-CSDN博客