Wiki-UX / Logical Volume Manager / How to keep a spare mirror before a major system upgrade
Jump to: navigation, search

How to keep a spare mirror before a major system upgrade


This document describes a method to use LVM Mirror-UX to keep a backup copy of the bootable LVM /dev/vg00 volume group prior to a major system upgrade. The traditional and recommended method is using Ignite-UX make_tape_recovery | make_net_recovery commands. Alternative on HP-UX 11i v2 and above, Dynamic Root Disk provided a similar approach were /dev/vg00 is cloned to a spare disk that can be used to reduce downtime during major system upgrades.

The procedures work better on systems where the OLR feature patches are installed. In systems where the patches are not installed is necesary to shutdown to physically remove the spare mirror copy.

The nature of the procedure can be explained in a single phrase: "Remove one of the /dev/vg00 mirror disks and keep it on your safe box."



Remember that on HP-UX 11i v3 the device special files names to the disks have change to Agile View naming. The names change from /dev/dsk/c#t#d# to /dev/disk/disk#. On Integrity systems also the EFI partitions have change from /dev/dsk/c#t#d#s# to /dev/disk/disk#_p#.

1. Create a current Ignite-UX backup. That is the last resort recovery media before a cold install.

2. Verify that both disk are configure to boot without quorum restrictions


# lifcp /dev/dsk/rdsk:AUTO -

On Integrity:

# efi_cp -d /dev/rdsk/c#t#d#s1 -u /EFI/HPUX/AUTO /tmp/auto
# cat /tmp/auto

3. Verify that you can boot the system from the alternate path. Reboot your server and boot from the alternate path. Booting to single user mode or to init 1 is enough to test that the system is bootable if all the logical volumes of /dev/vg00 are mirrored.

4. Disable one of the LVM physical volumes that contains the mirrors:

# pvchange -a n /dev/dsk/c#t#d#

If the OLR patches are not installed, reboot the system, remove from the Hotplug bay the disk you want to preserve and boot from the other disk is still on the system.

5. Perform all the system updates. All the changes are store on the disk kept on the system.

6. When you verify that all the updates are perform and the system is working as expected, insert and enable the other mirror:

  1. # ioscan -fnC disk
  2. # pvchange -a y /dev/dsk/c#t#d# or # vgchange -a y /dev/vg00
  3. # vgsync /dev/vg00

If anything or everything goes wrong, just remove the failed updated disk, swap the drives and boot the system from the good spare drive. After that, follow this procedure to rebuild the mirror on the wrong drive.

Rebuild mirror on PA-RISC

  1. Insert the bad drive
  2. # dd if=/dev/zero of=/dev/rdsk/c#t#d# bs=1024k count=256
  3. # vgcfgrestore -n vg00 /dev/rdsk/c#t#d#
  4. # mkboot /dev/rdsk/c#t#d#
  5. # mkboot -a "hpux -lq" /dev/rdsk/c#t#d#
  6. # vgcfgrestore -n vg00 /dev/rdsk/c#t#d#
  7. # pvchange -a y /dev/dsk/c#t#d# or # vgchange -a y /dev/vg00
  8. # vgsync vg00

Rebuild mirror on Integrity system

  1. Insert the bad drive
  2. # dd if=/dev/zero of=/dev/rdsk/c#t#d#s2 bs=1024k count=256
  3. # mkboot -e -l /dev/rdsk/c#t#d#
  4. # print 'boot vmunix -lq\n' > /tmp/auto
  5. # efi_cp –d /dev/rdsk/c#t#d#s1 /tmp/auto /EFI/HPUX/AUTO
  6. # vgcfgrestore -n vg00 /dev/rdsk/c#t#d#s2
  7. # pvchange -a y /dev/dsk/c#t#d#s2 or # vgchange -a y /dev/vg00
  8. # vgsync vg00

Why using lvmerge / lvsplit is not recommended?

Is very common to try using the lvsplit / lvmerge commands instead of the above procedure, but using this commands has important drawbacks, specially if you assume worst case scenarios:

  • Syntax mistakes using the lvmerge command during a "panic recovery" or "commit of changes" may prove fatal or at least extremely disappointing.
  • If the system need to be rebooted due to kernel changes during process follow by system crash or application failure, it may be prove difficult or impossible to boot from the splitted image.
  • In case of failure, lvmerge cannot be use on a live system and expect everything to be resolved (there are daemons, process and files running on a live system). Is required to boot the system in maintenance mode, lvmerge correctly (point 1) and reboot. That may probe more difficult to troubleshoot that just swapping the disks.
  • To boot from the split image, it requires the usage of lvrmboot and lvlnboot commands to correctly set the LVM bootable structures, sometimes this may need to boot from cd media or ignite make_tape_recovery to use a Recovery Shell, and sometimes neither are at hand.



This page was last modified on 3 August 2011, at 19:13. This page has been accessed 2,189 times.