LVM remove physical volume

This article will show you the way to remove physical volume from logical volume group. The scenario as below:

Your machine have volume group named sonnst-vg. This group contains two physical volumes: sda5 and sdb1. And now, you want to remove sdb1 from sonnst-vg. See the details with lvdisplay command:

You should pay attention to “Physical extents 0 to 20478”. To remove, you use command lvreduce as below:

(Before try this command, please backup everything in your disk :))

Please note that number 20479 is calculated by 20478 + 1

Test the result with lvdisplay:

Reboot for now.