• 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 : Move a Physical Volume from an existing Volume Group to another Volume Group

By admin

This post describes how to move a Physical Volume from an existing Volume Group to another existing Volume Group. This facilitates the move of data in the PV to the new VG without doing any manual migration.

Before moving a PV, you should make sure that the Logical Volumes created on top of such PVs does not share physical extents with other PVs. You can find the extent and device of an LV using the command given below;

# lvdisplay -m

Steps involved

1. Unmount the directory .

# umount /data01

2. Deactivate the active LVs on the device.

# lvchange -a n /dev/data_vg/lv_data01

3. Split the VG to a new temp VG and rescan the PVs

# vgsplit data_vg tempvg PV
# pvscan

The pvscan command will list the available PVs and their VGs.

4. Merge the tempvg to the destination VG

# vgmerge dest_vg tempvg
# pvscan

5. After everything is listed correctly in the pvscan command, activate the LVs.

# lvscan
# lvchange -a n /dev/dest_vg/lv_data01

6. Mount the LVs correctly.

# mount -t [filesystem_type] /device /dir

Filed Under: Linux

Some more articles you might also be interested in …

  1. watch command examples to run a command repeatedly or monitor dynamically changeable files (like /proc/*)
  2. Linux / UNIX : How to find files which has SUID/SGID set
  3. CentOS / RHEL 5 : How to install and configure vsftpd server
  4. /etc/rsyslog.conf – Setup a Filter to Discard or Redirect Messages
  5. Choosing SSSD or Winbind & Samba for Active Directory Integration in CentOS/RHEL
  6. Linux OS Service ‘cpuspeed’
  7. How to install CentOS / RHEL 7 on RAID Partition
  8. How to find which rpm package provides a specific file or library in RHEL / CentOS
  9. How to map /dev/sdX and /dev/mapper/mpathY device from the /dev/dm-Z device
  10. iSCSI troubleshooting : Targets Not Detected After Reboot

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ICMP redirects on CentOS/RHEL
  • What are Oracle Key Vault Roles
  • What Is Oracle Key Vault
  • Auditing with Oracle Database Vault Reports
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary