• 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 : 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. debsecan Command Examples in Linux
  2. Magento 2.3.3 Redis cache grows unlimited
  3. Maintaining Linux filesystems using “fsck” and “tune2fs”
  4. e2label: command not found
  5. How to create an XFS Filesystem
  6. How to disable Ctrl+Alt+Del causing system reboot in CentOS/RHEL 6
  7. journalctl Command Examples in Linux
  8. Change default kernel (boot with old kernel) in CentOS/RHEL/OEL 5 and 6
  9. aura Command Examples
  10. yum Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright