This is just an artifact of how
lsblk displays devices composed of multiple parts.The total size of
centos-root LVM logical volume is 150G, but analyzing exactly how much of it is physically located on
sda2 and how much on
sda3 would require investigating the LVM mappings in detail, and apparently
lsblk does not analyze LVM constructs quite that deeply.
The sum of the current sizes of
centos-home seems to be 199G, which is exactly the sum of the current sizes of
sda3 as well.
You would see the same effect with software RAID0 or RAID5 sets. Using
lsblk -s to show first the filesystem-containing constructs and then a breakdown of physical devices they're composed of might be an enlightening alternate view here.
You should use
parted to expand
sda3 instead, since that's the partition that is physically located next to the free space. On older RHEL/CentOS versions you might have needed
partprobe /dev/sda3 to tell the kernel to re-detect the partition size, but modern partition sizing tools should handle that automatically for you.
The next step would be
pvresize /dev/sda3 to automatically expand the LVM PV to match the new size of the partition it's located in. This will give you free space in the LVM volume group (viewable with
vgdisplay), which you can then use to extend your existing logical volumes or to create new ones.
For example, to add 20G of the added space to your
/home filesystem, you could do:
lvextend -r -L +20G /dev/mapper/centos-home
-r option (available in CentOS 7 and newer) the filesystem will be automatically resized with the LV.
/boot filesystem seems to be XFS, I think I don't need to worry about CentOS 6.x and older.)
If you feel antsy about resizing existing partitions (old school), you could also use the new space to create a new partition
parted or similar), set its type/flag to
lvm, and then initialize it for LVM use and add it to your existing
centos volume group:
vgextend centos /dev/sda4
After this would be the
lvextend step as above.
The end result is slightly aesthetically less pleasing than having the existing partition extended, but there should be no measurable difference in performance.