Expand disk with LVM

This article will guide to expand disk with LVM. My scenario is I install linux in virtual machine VMWare. And I use VMWare to expand disk (sdb) from 80G to 160G. So now, I need to setup linux machine to use expanded disk.

At the first, check disks with fdisk

You can see in the output that /dev/sdb is 160 Gb. However, we just create a partition sdb1 (80G).

So use fdisk to add a new partition sdb2  (type Linux LVM)

Step 2, create physical volume with pvcreate:

Step 3, extend volume group:

Extend logical volume

Finally, re-size file system: