CentOS-7 disk partition expansion

The existing disk storage of the server is "80G", and now it needs to be expanded online to "100G"

键入命令:fdisk -l

insert image description here

Proxmox VE interface to resize disk

insert image description here

After the adjustment is complete, check the disk size on the server

键入命令:fdisk -l

insert image description here

create partition

键入命令:fdisk /dev/sda
        键入:n (增加分区)
键入:p(增加主分区)
        键入:回车("分区号、起始扇区 " 保持默认)
最后:w(保存并退出)

insert image description here

Check the disk partition information to see if there is a new partition "/dev/sda3"

键入命令:fdisk -l

insert image description here

create physical volume

键入命令:pvcreate /dev/sda3
	如果提示sda3找不到,键入:partprobe 或者 重启虚拟机

insert image description here

Use vgscan to query physical volume names

键入命令:vgscan

insert image description here

Use vgextend to add a new physical volume extension "centos"

 1. 键入命令:vgextend centos /dev/sda3
 2. 键入命令:lvextend -L +20G /dev/mapper/centos-root
 	 ”/dev/mapper/centos-root“ 为要扩展的分区名称

insert image description here

Use fdisk -l to view "/dev/mapper/centos-root" file system size changes

键入命令:fdisk -l

insert image description here

Use df -h to see that the "/" directory has not been changed, and the file system needs to be expanded

 1. 键入命令:df -h 
 2. 键入命令:xfs_growfs /dev/mapper/centos-root 
 3. 键入命令:df -h

insert image description here

Guess you like

Origin blog.csdn.net/wkl1007/article/details/111554117