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.

Overall Procedure

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:

Procedure to rescan the SCSI bus to add or remove a SCSI device without rebooting the computer

Once SAN devices are visible again, please use pvscan command to rediscover older physical volumes:

$ pvscan

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>

Ramdev

Ramdev

I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

3 Responses

  1. September 17, 2015

    […] Read – Migrating LVM2 volumes from RHEL 5 to RHEL 6 […]

  2. September 17, 2015

    […] Read –  Migrating LVM2 volumes from RHEL 5 to RHEL 6 […]

  3. September 22, 2015

    […] Read – Migrating LVM2 volumes from RHEL 5 to RHEL 6 […]

What is in your mind, about this post ? Leave a Reply

Close
  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us