Show Table of Contents
5.3.15. Moving a Volume Group to Another System
You can move an entire LVM volume group to another system. It is recommended that you use the
vgimportcommands when you do this.
As of Red Hat Enterprise Linux 6.5, you can use the
--forceargument of the
vgimportcommand. This allows you to import volume groups that are missing physical volumes and subsequently run the
vgexportcommand makes an inactive volume group inaccessible to the system, which allows you to detach its physical volumes. The
vgimportcommand makes a volume group accessible to a machine again after the
vgexportcommand has made it inactive.
To move a volume group form one system to another, perform the following steps:
- Make sure that no users are accessing files on the active volumes in the volume group, then unmount the logical volumes.
- Use the
-a nargument of the
vgchangecommand to mark the volume group as inactive, which prevents any further activity on the volume group.
- Use the
vgexportcommand to export the volume group. This prevents it from being accessed by the system from which you are removing it.After you export the volume group, the physical volume will show up as being in an exported volume group when you execute the
pvscancommand, as in the following example.
pvscanPV /dev/sda1 is in exported VG myvg [17.15 GB / 7.15 GB free] PV /dev/sdc1 is in exported VG myvg [17.15 GB / 15.15 GB free] PV /dev/sdd1 is in exported VG myvg [17.15 GB / 15.15 GB free] ...When the system is next shut down, you can unplug the disks that constitute the volume group and connect them to the new system.
- When the disks are plugged into the new system, use the
vgimportcommand to import the volume group, making it accessible to the new system.
- Activate the volume group with the
-a yargument of the
- Mount the file system to make it available for use.