解决虚拟机Centos7根目录磁盘已满,扩容
1.df 命令查看各文件系统的使用情况 2.给虚拟机扩展空间 3.fdisk -l 命令查看磁盘名称
4.新建分区并格式化 命令:fdisk /dev/sda 5.重启机器 reboot
6.格式化新分区,进入LVM
命令:mkfs.ext3 /dev/sda3
[root@localhost ~]
lvm> pvcreate /dev/sda3
WARNING: ext3 signature detected on /dev/sda3 at offset 1080. Wipe it? [y/n]: y
Wiping ext3 signature on /dev/sda3.
Physical volume "/dev/sda3" successfully created
lvm> vgextend centos /dev/sda3
Volume group "centos" successfully extended
lvm> lvextend -l +71679 /dev/mapper/centos-root
Size of logical volume centos/root changed from 16.70 GiB (4276 extents) to <296.70 GiB (75955 extents).
Logical volume centos/root successfully resized.
lvm> quit
Exiting.
[root@localhost ~]
7.最后扩容成功
|