Linux LVM Data Migration

There are many validations that need to be done before executing the below steps/commands such as target disk compatibility with the server/server load/all target disks have the fully redundant paths/MPIO is configured as per current vendor best practice etc.

Our preferred way of doing any data migration from one set of disks to another is to mirror the disks and then break the mirror. We use lvconvert to achieve this on Linux. There are other ways to migrate the data such as pvmove which can be used in certain cases. There are many other options that may be applicable for your environment. We can help identify best option for you and automate your migrations and fast track the project. Email us at intro@yarisolutions.com to find out how.

lvconvert high level migration procedure :

  1. Identify the volume groups you would like to migrate

  2. Identify each LV per VG

  3. Identify the source disks in use per LV and its size

  4. Ask storage admins to allocate new disks for migration. Allocated space should be larger than the lv size

  5. Map the allocated storage for each vg/lv.

  6. use lvconvert -m1 vg/lv <target disks>

  7. Check the mirror status using lvs -a -o name,copy_percent,devices <vg name>

  8. Check lv details using lvs --all --segments -o +devices

  9. Wait for copy to finish. Once 100% copy is done.

  10. Break the mirror using lvconvert -m0 vg/lv <source disks>

  11. Remove the <source disks> from vg using vgreduce command

  12. Delete the disks from lvm using pvremove

  13. Repeat the process for each vg/lv in the system that you are looking to migrate.

  14. Delete multipathing entries

  15. Ask storage admins to reclaim the source disks.

  16. Clean up the server of all the dead paths/disks after reclaim.

PVMove high level migration procedure :

  1. Identify the volume groups you would like to migrate

  2. Identify source disks per VG using vgs -o +pv_name command.

  3. For each VG request for target disks larger than total VG size. You can ask for same # of disks as source or any other size you like based on the new storage vendor best practice. The only requirement is that total size be larger than current size of VG.

  4. Once storage has been allocated rescan for new disks

  5. Identify and map which target disks were allocated for which VG.

  6. initialize the target disks using pvcreate command

  7. Add the target disks to VG using vgextend command

  8. use pvmove —alloc anywhere <source disk>

  9. vgreduce <source disk>

  10. pvremove <source disk>

  11. Repeat steps 8, 9 and 10 for each source disks in VG.

  12. Repeat steps 5 through 11 for each VG

  13. Ask storage admin to reclaim all the migrated disks

  14. Clean up the server of all the dead paths/disks after reclaim.

Previous
Previous

AIX LVM Data migration

Next
Next

Storage Data Migration flow