CentOS / RHEL : How to add a new Physical Volume to an existing Volume Group

You might want to add new PV in existing VG so extend an LV or to grow your VG. In this example, a new 10Gg block device (whether a partition, LUN or new physical disk) is added to an existing Volume Group (VG) containing one fully utilized 10Gb Physical Volume (PV).

Before proceeding, run the following commands – record output for later use.

# fdisk -l /dev/sdc

Disk /dev/sdc: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdd344dac

      Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1305    10481388+  83  Linux
# cat /proc/partitions | grep sdc
   8    16  10485760 sdc
   8    17  10481388 sdc1
# pvs
PV         VG           Fmt  Attr PSize  PFree
/dev/sdb1  VolGroupData lvm2 a-   10.00G 4.00M
# vgs
VG           #PV #LV #SN Attr   VSize   VFree
VolGroupData   1   1   0 wz--n- 10.00G 4.00M
# lvs
LV           VG           Attr   LSize  Origin Snap%  Move Log Copy%  Convert
LogVolData01 VolGroupData -wi-ao 9.99G

Create new Physical Volume

Create a new Physical Volume (PV) on the new device(s) e.g.:

# pvcreate /dev/sdc1
Writing physical volume data to disk "/dev/sdc1"
Physical volume "/dev/sdc1" successfully created

Add the Physical Volume to the Volume Group

Add the new Physical Volume (PV) to the existing Volume Group (VG) e.g.:

# vgextend VolGroupData /dev/sdc1
Volume group "VolGroupData" successfully extended

Verify Volume Group resize

Verify the increased size of the Volume Group e.g.:

# vgs
VG           #PV #LV #SN Attr   VSize   VFree
VolGroupData   2   1   0 wz--n-  19.99g 10.00g
# vgdisplay VolGroupData
--- Volume group ---
VG Name               VolGroupData
System ID
Format                lvm2
Metadata Areas        2
Metadata Sequence No  5
VG Access             read/write
VG Status             resizable
MAX LV                0
Cur LV                1
Open LV               0
Max PV                0
Cur PV                2
Act PV                2
VG Size               19.99 GiB
PE Size               4.00 MiB
Total PE              5118
Alloc PE / Size       2558 / 9.99 GiB
Free  PE / Size       2560 / 10.00 GiB
VG UUID               pkIDJY-jJjd-3R9k-qiER-8VbM-dYkv-LWGEJE
# pvs
PV         VG           Fmt  Attr PSize   PFree
/dev/sdb1 VolGroupData lvm2 a--   10.00g  4.00m
/dev/sdc1 VolGroupData lvm2 a--   10.00g 10.00g
Related Post