CentOS / RHEL : How to add Physical Volume (PV) to a Volume group (VG) in LVM

You may want to add new physical volumes to an existing volume group when logical volumes need to be increased in size or number, but there is no more room on the volume group to accommodate this expansion. The physical volume can either be a partition or an entire disk. For this post we will consider a whole disk for addition into an existing volume group.

Adding PV to VG

1. Set the partition type to Linux LVM, 0x8e, using fdisk.

# fdisk /dev/sdc

Type t to select the partition:

Command (m for help): t
Partition number (1-4): 1

Set partition type as 8e which for Linux LVM.

Hex code (type L to list codes): 8e

## So the output of the partition type 8e is

 Device Boot      Start         End      Blocks    Id   System
/dev/sdc1          1675        2054     3052087   8e  Linux

Finally save and exit fdisk with the write/quit command (w). Note: Changes will be permanent after this command is executed.

Command (m for help): w

2. Make sure you reload the partition table after changing it by either rebooting the machine or running partprobe.

# partprobe

3. The partition/disk needs to be added as a physical volume using pvcreate.

# pvcreate /dev/sdc1

4. The physical volume needs to be added to the volume group using vgextend.

# vgextend vg_data /dev/sdc1
Related Post