Mirroring root disk on HP-UX 11iv3

This post have been resting in a dust a way too long but now I’m going to fix that by guiding you through a very important and sometimes a vital process as a root disk mirroring on HP-UX. Truth to be told that there is no single grain of rocket science so treat it as a pure reference. Lets imagine that disk3 is a current boot device and disk5 will be our new mirror.

  1. Run the following commands to determine the size (in megabytes) of EFI, HP-UX and HSPS of the boot device:
  2. # diskinfo -b /dev/rdisk/disk3_p1 | awk '{print $1/1024}'
    # diskinfo -b /dev/rdisk/disk3_p2 | awk '{print $1/1024}' 
    # diskinfo -b /dev/rdisk/disk3_p3 | awk '{print $1/1024}'
    
  3. Next, prepare a file, i.e. /tmp/partitionfile, with the following content:
  4. 3
    EFI 500MB
    HPUX 100%
    HPSP 400MB
    
  5. It’s quite convenient to have a list of disks before making the changes so once they’re applied they will be vividly visible at once:
  6. # ioscan -fnC disk
    # ioscan -m dsf
    
  7. Create the partitions on a new disk and with insf command make them available to OS by creating the device files:
    # idisk -f /tmp/partitionfile -w /dev/rdisk/disk5
    # insf -e 
    
  8. Make it bootable:
  9. # pvcreate -f -B /dev/rdisk/disk5_p2 
    
  10. Extend the root volume group:
  11. # vgextend vg00 /dev/disk/disk5_p2 
    Volume group "vg00" has been successfully extended.
    Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf
    
  12. To complete the setup of the disk as a boot disk run mkboot command:
  13. # mkboot -e -l /dev/disk/disk5
    

    The -e option tells mkboot to use EFI layout and the -l option tells mkboot that this volume will be used by a volume manager (even if it is not currently used by one)

  14. Create a temporary AUTO file and use the efi_cp command to copy it to the mirror, using the block device of the first (EFI) partition. The –lq option ensures that the system will boot without quorum. In the event of the primary boot disk failing this will allow the mirror disk to boot.
  15. # print 'boot vmunix -lq' > /tmp/AUTO
    # efi_cp -d /dev/disk/disk5_p1 /tmp/AUTO EFI/HPUX/AUTO
    
  16. Now proceed with mirroring your logical volumes. I used pvdisplay to get an ordered list of the volumes to be able to create the mirrored volumes in the same order.
  17. # pvdisplay -v /dev/disk/disk3_p2 | grep "current.*00000"
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol1 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol2 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol3 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol4 /dev/disk/disk5_p2
    # /usr/sbin/lvextend -m 1 /dev/vg00/lvol5 /dev/disk/disk5_p2
    ...
    
  18. Prepare LVM logical volume to be root, boot, primary swap, or dump volume:
  19. # /usr/sbin/lvlnboot -b /dev/vg00/lvol1
    # /usr/sbin/lvlnboot -r /dev/vg00/lvol3
    # /usr/sbin/lvlnboot -s /dev/vg00/lvol2
    # /usr/sbin/lvlnboot -d /dev/vg00/lvol2
    # /usr/sbin/lvlnboot –R
    
  20. Finally, add the new disk to boot device configuration table:
  21. # /usr/bin/echo “l /dev/disk/disk5_p2” >> /stand/bootconf
    
  22. Set the alternate boot path to the mirror_disk:
  23. # /usr/sbin/setboot -a /dev/disk/disk5_p2
    
  24. If the mirror disk includes an HPSP partition, use the efi_fsinit command on the character device file for the HPSP (third) partition to initialize it with an EFI file system:
  25. # /usr/sbin/efi_fsinit -d /dev/rdisk/disk5_p3
    
Posted on September 2, 2010 at 7:17 pm by sergeyt · Permalink
In: HP-UX

6 Responses

Subscribe to comments via RSS

  1. Written by RickVR
    on November 16, 2014 at 2:24 pm
    Reply ·