Groesbeek, view of the 'National Liberation Museum 1944-1945' in Groesbeek. © Ton Kersten
Fork me on GitHub
Archive for April 2009

HP/UX LVM migration

2009-04-02 (6) by Ton Kersten, tagged as old

For a customer of us we needed to migrate the complete SAN data on HP/UX 11.x machines to a new SAN. This can be done by creating a complete backup, connecting the new SAN and doing a complete restore. Not only does this take a lot of time, it also means a lot of down time. And, as you can guess, this was not an option.

Well, we had to think of something else. After giving it some thought we decided that we could solve this problem with LVM mirroring.

It goes like this:

Make sure the new SAN devices are visible

   ioscan -Cdisk

Create the device files

    insf -Cdisk

Find out what the current device of a volume group is

    vgdisplay -v

Give the next command sequence

   pvcreate /dev/rdsk/
    vgextend /dev/ /dev/dsk/
    for f in $(vgdisplay -v  | awk '/LV Name/ { print $3 }')
        lvextend -m 1 ${f} /dev/dsk/ /dev/dsk/

Now it's time for some coffee and a long wait. The system mirrors all logical volumes in the volume group

After the mirroring is done

   for f in $(vgdisplay -v  | awk '/LV Name/ { print $3 }')
        lvreduce -m 0 ${f} /dev/dsk/

After some testing time, when the system is considered fully functional, the old SAN can be disconnected. This can leave stale devices, but that can be solved easily with a reboot.

    pvreduce  /dev/dsk/