Redhat Linux Migration: Migrating LVM2 volumes from RHEL 5 to RHEL 6
Migration Case Study
One of our Server currently installed with RHEL 5 and having LVM2 volumes that are created using SAN devices. Due to some application requirements, we want to reinstall the same host with RHEL6 and migrate the original RHEL5 based LVM2 volumes to RHEL6.
Step 1: Backup the Content
It is recommended to backup all the critical data and verify the backup before migrating LVM2 volumes from RHEL 5 to 6 as an unforeseen problem might occur.
Step 2: Unmount the Volume from Source RHEL5 Machine
In RHEL 5 system, umount the file system ( If required make use of rescue mode ). Make sure that no users are accessing files on the active volume.
$ umount <path_to_lvm_volumes>
Step 3: Mark the volume group inactive
Marking the volume group inactive removes it from the kernel and prevents any further activity on it.
$ vgchange -an <vg_name>
Step 4: Export the volume group
This prevents it from being accessed on the host system and prepares it to be removed.
$ vgexport <vg_name>
Step 5: Disconnect the SAN Storage from Source Machine
Shut down the system.
Temporarily disconnect the SAN devices from RHEL 5 system, by unplugging FC cable connected to the FC HBAs on system while it is shutdown.
(You can temporarily disconnect the FC cable just to avoid any chances of mistakenly modifying SAN devices during RHEL 6 fresh installation.)
Step 6: Reinstall the Machine using RHEL6
Boot the system with RHEL 6 installation DVD and perform fresh installation. Once the RHEL 6 installation is completed
Step 7: Reconnect the SAN and Rescan the Storage Devices
Reconnect the FC cable to HBAs and rescan the SCSI bus using steps described in following article:
Once SAN devices are visible again, please use pvscan command to rediscover older physical volumes:
Step 8: Re-import the Original volume groups
$ vgimport <vg_name>
Step 9: Activate the volume group
$ vgchange -ay <vg_name>
Step 10: Re-mount the file systems
$ mkdir -p <path_to_mount_point>
$ mount <path_to_lvm_volume> <path_to_mount_point>