HP: Mirroring bootdisks

Title:HP: Mirroring bootdisks
Author:Douglas O’Leary <dkoleary@olearycomputers.com>
Description:HP: Mirroring bootdisks
Date created:02/24/2011
Date updated:02/24/2011
Disclaimer:Standard: Use the information that follows at your own risk. If you screw up a system, don’t blame it on me...

This checklist is designed to have all of the relevent commands required to mirror an HPUX system. It’s broken out into pa-risc and itanium systems. Please note, from what I understand, the steps for mirroring 11.22 ia64 systems is different. I’ve never had the opportunity to play with those. If you have the steps and want to mail them to me, I’d appreciate it.

PA-RISC Mirroring procedures

  • Use ioscan to identify a suitable alternate boot disk. The disk should be about the same size as the primary boot disk and, preferably, on a separate I/O channel. When I do this, I typically set up variables for the character and block devices. The example commands that follow use that syntax.

  • Create the boot partitions on the disk. The args to ignore quorum are used on the hpux command. If you’re booting off of the alternate boot disk, there’s a better than even chance your primary isn’t there anymore...

    pvcreate -B ${rdsk}
    mkboot ${rdsk}
    mkboot -a "hpux -lq" ${rdsk}
    
  • Add the disk to vg00 - or whereever your OS is:

    vgextend vg00 ${dsk}
    
  • Extend the logical volumes. I typically use an inline function for this:

    for lv in $(vgdisplay -v vg00 | grep -i 'lv name' | awk '{print $NF}')
    do
        echo "#################################"
        echo ${lv}
        lvextend -m 1 ${lv} ${dsk}
    done
    

    NOTE: Each of the lvs can take awhile particularly if they’re sizeable. I will usually create a function in another window that tells me how many logical extents are stale. Rerunning the function will hopefully show a decreasing number of extents.

    hm()
    {  lvdisplay -v $1 | sed -n -e '/Logical extents/,$p' | \
          grep stale | wc -l
    }
    
  • Verification:

    • Use setboot to verify the alternate boot or HA alternate boot, as appropriate, is set:

      # setboot
      Primary bootpath : 0/1/1/0.1.0
      HA Alternate bootpath : 0/1/1/0.0.0
      Alternate bootpath : 0/1/1/0.1.0
      
      Autoboot is ON (enabled)
      
    • Use lvlnboot to verify the alternate boot disk is configured. Use lvlnboot -R /dev/vg00 to update.

      # lvlnboot -v vg00
      Boot Definitions for Volume Group /dev/vg00:
      Physical Volumes belonging in Root Volume Group:
              /dev/dsk/c2t1d0s2 (0/1/1/0.1.0) -- Boot Disk
              /dev/dsk/c2t0d0s2 (0/1/1/0.0.0) -- Boot Disk
      Boot: lvol1     on:     /dev/dsk/c2t1d0s2
                              /dev/dsk/c2t0d0s2
      Root: lvol3     on:     /dev/dsk/c2t1d0s2
                              /dev/dsk/c2t0d0s2
      Swap: lvol2     on:     /dev/dsk/c2t1d0s2
                              /dev/dsk/c2t0d0s2
      Dump: lvol2     on:     /dev/dsk/c2t1d0s2, 0
      

Itanium mirroring procedure

As stated previously, the ia64 mirroring procedure is quite different. Using the old disk naming schemes, you will end up creating disk partitions, ${rdsk}s2, for instance. The new naming conventions create partitions named /dev/rdisk/disk#_p#. The directions below demonstrate the legacy naming convention. The commands are the same for the new naming convention.

  • Use ioscan to identify a suitable alternate boot disk. The disk should be about the same size as the primary boot disk and, preferably, on a separate I/O channel. When I do this, I typically set up variables for the character and block devices. The example commands that follow use that syntax.

  • Create the boot partition on the disk and generate the partition device files:

    • Create the partition template:

       cat > /tmp/part << eof
      > 3
      > EFI 500MB
      > HPUX 100%
      > HPSP 400MB
      > eof
      
    • idisk -f /tmp/part -w ${rdsk}

    • Verify the partitions: idisk ${rdsk}

    • Create the device files: insf -eH ${hw_path}

  • Create and populate the boot partitions:

    pvcreate -B ${rdsk}s2 NOTE: the s2 partition
    mkboot -e -l ${rdsk}
    mkboot -a "boot vmunix -lq" ${dsk} NOTE: not rdsk
    
  • vgextend vg00 ${dsk}s2 #note the s2 partition again

  • Extend the logical volumes. I typically use an inline function for this:

    for lv in $(vgdisplay -v vg00 | grep -i 'lv name' | awk '{print $NF}')
    do
        echo "#################################"
        echo ${lv}
        lvextend -m 1 ${lv} ${dsk}s2 # note the s2 partition again
    done
    

    NOTE: Each of the lvs can take awhile particularly if they’re sizeable. I will usually create a function in another window that tells me how many logical extents are stale. Rerunning the function will hopefully show a decreasing number of extents.

    hm()
    {  lvdisplay -v $1 | sed -n -e '/Logical extents/,$p' | \
          grep stale | wc -l
    }
    
  • Verification:

    • Use setboot to verify the alternate boot or HA alternate boot, as appropriate, is set:

      # setboot
      Primary bootpath : 0/1/1/0.1.0
      HA Alternate bootpath : 0/1/1/0.0.0
      Alternate bootpath : 0/1/1/0.1.0
      
      Autoboot is ON (enabled)
      
    • Use lvlnboot to verify the alternate boot disk is configured. Use lvlnboot -R vg00 to update.

      # lvlnboot -v vg00
      Boot Definitions for Volume Group /dev/vg00:
      Physical Volumes belonging in Root Volume Group:
              /dev/dsk/c2t1d0s2 (0/1/1/0.1.0) -- Boot Disk
              /dev/dsk/c2t0d0s2 (0/1/1/0.0.0) -- Boot Disk
      Boot: lvol1     on:     /dev/dsk/c2t1d0s2
                              /dev/dsk/c2t0d0s2
      Root: lvol3     on:     /dev/dsk/c2t1d0s2
                              /dev/dsk/c2t0d0s2
      Swap: lvol2     on:     /dev/dsk/c2t1d0s2
                              /dev/dsk/c2t0d0s2
      Dump: lvol2     on:     /dev/dsk/c2t1d0s2, 0
      
  • Update the boot loader

    This part is still a bit confusing for me. The alternate boot option in the efi boot menu points to the right disk; however, it doesn’t know about the hpux.efi boot command so it doesn’t work. You’d figure HP would make that a bit more automatic.

    So, note the hardware paths for the primary and alternate disks, then boot to the efi menu. Boot configuration -> Add a boot option,

    Identify your new mirror disk. when it says (pun1,lun0), that’s going to be c#t1d0, (pun0,lun) will be c#t0d0, etc. Highlight the suspected mirror disk and press [enter]

    Assuming you got the right disk, you should be looking at something that looks like an old norton commander menu. Highlight EFI, press [enter], then highlight HPUX, press [enter], and finally, hpux.efi and (you guessed it), press [enter]. Enter a good description for the mirror disk.

    If you want, move the mirror disk entry to the top using the other options in the boot options menu. Once done, select the mirror disk entry to attempt to boot from it.

    Troubleshoot as necessary