• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

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

by admin

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

Filed Under: Linux

Some more articles you might also be interested in …

  1. fscrypt Command Examples in Linux
  2. check-language-support: command not found
  3. Rabbitmq install and management
  4. mkfs.exfat Command Examples in Linux
  5. i3lock Command Examples in Linux
  6. mate-search-tool Command Examples in Linux
  7. grub-mkconfig: command not found
  8. How to Disable VNC Server from Xinetd in CentOS/RHEL 7
  9. ClusterSSH(cssh) – Manage Multiple SSH Sessions on Linux
  10. CentOS / RHEL : How to find free space in a Volume Group in LVM

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright