df -h vgdisplay vgdisplay -v centos
fdisk -l
主要輸入:n p w,其餘的就默認就好centos
[root@backup03 ~]# fdisk /dev/sda Command (m for help): n Select (default p): p Partition number (3,4, default 3): First sector (25593856-104857599, default 25593856): Using default value 25593856 Last sector, +sectors or +size{K,M,G} (25593856-104857599, default 104857599): Using default value 104857599 Partition 3 of type Linux and of size 37.8 GiB is set Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8 Syncing disks.
[root@backup03 ~]# partprobe Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.
[root@backup03 ~]# pvcreate /dev/sda3 Physical volume "/dev/sda3" successfully created. [root@backup03 ~]# pvdisplay
[root@backup03 ~]# vgextend centos /dev/sda3 Volume group "centos" successfully extended [root@backup03 ~]# vgdisplay -v centos
這裏37G要按照實際狀況來。固然也能夠不掛在/dev/centos/root,有些是掛在/dev/centos/home裏面的。ide
lvextend -L +37G /dev/centos/root vgdisplay -v
df -h
mount
xfs_growfs /dev/centos/root
df -h