Using MirrorDisk/UX to mirror vg00 on an HP-UX 11.31 Itanium server

Where PRIMARY is the current OS disk and SECONDARY is the disk on which you want to create the mirror:

# idisk -Rw /dev/rdisk/SECONDARY

# echo "3" > /tmp/pdf
# echo "EFI $(diskinfo /dev/rdisk/PRIMARY_p1 | grep size | while read label size kbytes; do echo ${size}/1024 | bc; done)MB" >> /tmp/pdf
# echo "HPUX $(diskinfo /dev/rdisk/PRIMARY_p2 | grep size | while read label size kbytes; do echo ${size}/1024 | bc; done)MB" >> /tmp/pdf
# echo "HPSP $(diskinfo /dev/rdisk/PRIMARY_p3 | grep size | while read label size kbytes; do echo ${size}/1024 | bc; done)MB" >> /tmp/pdf

# idisk -f /tmp/pdf -w /dev/rdisk/SECONDARY
# idisk /dev/rdisk/SECONDARY

# ioscan; insf -e -C disk; ioscan -fnNC disk

# efi_fsinit -d /dev/rdisk/SECONDARY_p1
# pvcreate -B /dev/rdisk/SECONDARY_p2
# vgextend vg00 /dev/disk/SECONDARY_p2
# mkboot -e -l /dev/rdisk/SECONDARY

# efi_ls -d /dev/rdisk/PRIMARY_p1
# efi_ls -d /dev/rdisk/SECONDARY_p1

# lifls -l /dev/rdisk/PRIMARY_p2
# lifls -l /dev/rdisk/SECONDARY_p2

# mkboot -a "boot vmunix -lq" /dev/rdisk/PRIMARY
# mkboot -a "boot vmunix -lq" /dev/rdisk/SECONDARY

# efi_cp -d /dev/rdisk/PRIMARY_p1 -u /EFI/HPUX/AUTO /tmp/prim
# cat /tmp/prim

# efi_cp -d /dev/rdisk/SECONDARY_p1 -u /EFI/HPUX/AUTO /tmp/mir
# cat /tmp/mir

# for i in `pvdisplay -v /dev/disk/PRIMARY_p2 | grep 'current.*0000 $' | awk 'BEGIN{ ORS=" " }{ print $3 }'`; do echo lvextend -m 1 $i /dev/disk/SECONDARY_p2; done | sh -x

# lvlnboot -R /dev/vg00
# lvlnboot -v

# setboot -a SECONDARY_DISK_HW_PATH

# echo "1 /dev/disk/SECONDARY_p2" >> /stand/bootconf

# dd if=/dev/rdisk/PRIMARY_p3 of=/dev/rdisk/SECONDARY_p3 bs=1024k

Replace a failed vg00 disk

As long as a server utilizes hot-swappable hard drives and all logical volumes in vg00 are properly mirrored, there are three possible scenarios and associated required courses of action I have run into.

1)  PA-RISC server running HP-UX 11.00 or 11.11 without the OLAR patches for LVM and the kernel.

# for i in `vgdisplay -v vg00 | awk 'BEGIN{ ORS=" " }{ if ($0 ~ /LV Name/) print $3 }'`; do lvreduce -m 0 $i /dev/dsk/FAILED_DISK; done
# vgreduce vg00 /dev/dsk/FAILED_DISK

Replace disk
# ioscan -fnC disk
# insf
# pvcreate -B /dev/rdsk/FAILED_DISK
# vgextend vg00 /dev/dsk/FAILED_DISK
# mkboot /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/GOOD_DISK
# for i in `pvdisplay -v /dev/dsk/GOOD_DISK | grep 'current.*0000 $' | awk 'BEGIN{ ORS=" " }{ print $3 }'`; do lvextend -m 1 $i /dev/dsk/FAILED_DISK; done
# lifls /dev/rdsk/GOOD_DISK
# lifls /dev/rdsk/FAILED_DISK
# vgdisplay -v /dev/vg00
# setboot

2) PA-RISC server running HP-UX 11.11 with the OLAR patches or greater.

# pvchange -a N /dev/dsk/FAILED_DISK
Replace disk
# ioscan -fnC disk
# vgcfgrestore -n vg00 /dev/rdsk/FAILED_DISK
# pvchange -a y /dev/dsk/FAILED_DISK
# mkboot /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/FAILED_DISK
# mkboot -a "hpux -lq" /dev/rdsk/GOOD_DISK
# lifls /dev/rdsk/GOOD_DISK
# lifls /dev/rdsk/FAILED_DISK
# setboot

3) Itanium server

# pvchange -a N /dev/dsk/FAILED_DISK
Replace disk
# ioscan -fnC disk
# echo "3
EFI 500MB
HPUX 100%
HPSP 400MB" > /tmp/pdf
# idisk -f /tmp/pdf -w /dev/rdsk/FAILED_DISK
# idisk /dev/rdsk/FAILED_DISK
# insf -e -H HWPATH_FOR_FAILED_DISK
# vgcfgrestore -n vg00 /dev/rdsk/FAILED_DISK
# pvchange -a y /dev/dsk/FAILED_DISK
# mkboot -e -l /dev/rdsk/FAILED_DISK
# echo "boot vmunix -lq" > ./AUTO
# efi_cp -d /dev/rdsk/FAILED_DISK ./AUTO /efi/hpux/auto
# lvlnboot -R /dev/vg00
# lvlnboot -v

For more information:
HP-UX: When Good Disks Go Bad

Using MirrorDisk/UX to mirror vg00 on an HP-UX PA-RISC server

Where PRIMARY is the current OS disk and SECONDARY is the disk on which you want to create the mirror:


# pvcreate -B /dev/rdsk/SECONDARY
# vgextend /dev/vg00 /dev/dsk/SECONDARY
# mkboot /dev/rdsk/SECONDARY
# mkboot -a "hpux -lq" /dev/rdsk/SECONDARY
# mkboot -a "hpux -lq" /dev/rdsk/PRIMARY
# for i in `pvdisplay -v /dev/dsk/PRIMARY | grep 'current.*0000 $' | awk 'BEGIN{ ORS=" " }{ print $3 }'`; do lvextend -m 1 $i /dev/dsk/SECONDARY; done
# lifls /dev/rdsk/PRIMARY
# lifls /dev/rdsk/SECONDARY
# vgdisplay -v /dev/vg00
# setboot -a SECONDARY-HARDWARE-PATH