sudo fdisk /dev/sdc –> /dev/sdc1
Then issue "pvcreate /dev/sdc1".
This will add the disk to the physical volume group (pvdisplay), noticed the "VG name" is not assigned yet:
vgextend centos /dev/sdc1 —> after this the following 59.5 G is displayed.
And "sudo pvdisplay" will show that /dev/sdc1 is assigned to the VG group "centos".
But lvdisplay still showing old values:
Finally, "lvextend -l +100%FREE /dev/centos/root" and this will extend the VG extents to the 57G limit.
Finally, boot in rescue mode and do the following (this is for ext4 filesystem):
resize2fs /dev/mapper/centos-root
But if your filesystem is XFS, which is default for CentOS 7.2 1511:
The rootfs is running XFS, and XFS does allow online resizing.
So without any rebooting or rescue mode:
So now the rootfs have been properly resize by the command:
xfs_growfs -d /dev/mapper/centos-root
The option "-d" is for maximum possible size.
So in summary, for LVM only the last part is different between XFS and ext4 filesystem: resize2fs or xfs_growfs command.
You must be logged in to post a comment.