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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

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

By admin

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

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to configure VNC Server on CentOS/RHEL 6
  2. How to determine file and free space fragmentation of OCFS2
  3. Yum Fails with “Error: database disk image is malformed” in /var/log/messages
  4. vncserver fails with “Starting VNC server: no displays configured”
  5. Understanding the /etc/skel directory in Linux
  6. CentOS / RHEL : How to Disable / Enable direct root and non-root user ssh login
  7. CentOS / RHEL : How to convert volume group metadata between LVM1 and LVM2
  8. How to Permanently set the ethtool settings in CentOS/RHEL 6
  9. UNIX / Linux : What Is a Shell? What are different Shells?
  10. Understanding multipath Utility to Configure DM-Multipath

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary