UnixPedia : HPUX / LINUX / SOLARIS: HPUX : Root disk replacement in 11.31 version.

Friday, June 21, 2013

HPUX : Root disk replacement in 11.31 version.

  1.  

#Login as root and start a scriptlog.

 

script -a /var/adm/install-logs/IQ-mirror-rootdisk.scriptlog

# Step 1

uname -a

id

 

  1.  

#Find your second root disk.

#Set the variable MIRROR_DISK, with the short name of the entire disk (eg, #disk3, but not /dev/disk/disk3 or disk3_p2)

 

#Step 2

vgdisplay -v vg00|grep ‘PV Name’

ioscan -funNC disk | more

MIRROR_DISK=<short name of the entire disk, not a partition, eg. disk3. DO NOT USE THE FULL NAME.>

echo ${MIRROR_DISK}

 

  1.  

#Ensure the MIRROR_DISK is set correctly, as expected by this checklist.

 

#Step 3

ll /dev/disk/${MIRROR_DISK}   #No errors should be reported and device file for ENTIRE disk shown.

 

  1.  

# Determine the HW path of the disk, using the MIRROR_DISK variable

 

#Step 4

MIRROR_HW=`ioscan -m lun /dev/disk/${MIRROR_DISK}|awk '{if ( NR == 4 ) print $1}'`

echo $MIRROR_HW         #The Hardware path of the disk should be displayed.

 

ioscan -m hwpath -H $MIRROR_HW    #The lun h/w path and lunpath h/w path displayed.


 

  1.  

#Create Partition description file and partition the disk.

 

#Step 5

echo "3\nEFI 500MB\nHPUX 100%\nHPSP 400MB" > /tmp/idf

cat /tmp/idf

idisk -f /tmp/idf -w /dev/rdisk/${MIRROR_DISK}

idisk /dev/rdisk/${MIRROR_DISK} | more

 

  1.  

#Create device files for the new partition.

 

#Step 6

insf -eC disk

ll /dev/rdisk/${MIRROR_DISK}_p[123]

ioscan -m lun /dev/rdisk/${MIRROR_DISK}_p3  

 

  1.  

#Format partition 2 as a bootable lvm disk and add to vg00.

 

#Step 7

pvcreate -B /dev/rdisk/${MIRROR_DISK}_p2

vgextend vg00 /dev/disk/${MIRROR_DISK}_p2

 

  1.  

#Place boot utilities in the boot area.

 

#Step 8

mkboot -e -l /dev/rdisk/${MIRROR_DISK}

 

  1.  

#Create autoboot file.

 

#Step 9

mkboot -a "hpux -lq" /dev/rdisk/${MIRROR_DISK}

 

  1.  

#Mirror the LVs in the same order in which they are placed in the primary. Change to “m 2” in lvextend command below, if this is a second mirror (third disk).

 

#Step 10

PRIMARY_DISK=`vgdisplay -v vg00|awk '/PV Name/ { print  $3 }'|head -1`

 

echo $PRIMARY_DISK

 

for lv in `pvdisplay -v $PRIMARY_DISK|awk '/current.*0000 $/ {print $3 }’`

do

  echo Mirroring $lv

  lvextend -m 1 $lv /dev/disk/${MIRROR_DISK}_p2

done

 

vgdisplay -v vg00|more

           


 

  1.  

#Update root volume group information and verify that the mirrored disk is displayed as a boot disk and that the boot, root, and swap logical volumes appear to be on both disks.

 

#Step 11

lvlnboot -R /dev/vg00

lvlnboot -v

 

  1.  

#Specify mirror disk as HA alternate boot device in nvram. Change the setboot otion in first command to “-a” if this is a second mirror (third disk).

 

#Step 12

setboot -h $MIRROR_HW

setboot -v

 

  1.  

#Add a line to /stand/bootconf for the new boot disk if required.

 

#Step 13

cat /stand/bootconf

echo "l /dev/disk/${MIRROR_DISK}_p2" >> /stand/bootconf

cat /stand/bootconf

 

  1.  

#copy the HPSP partition.

 

#Step 14

PRIMARY_HPSP=`echo $PRIMARY_DISK|sed 's/2$/3/'`

dd if=$PRIMARY_HPSP of=/dev/rdisk/${MIRROR_DISK}_p3 bs=64k conv=sync

 

efi_ls -d /dev/disk/${MIRROR_DISK}_p3 EFI/HP/DIAG/ODE

 

 

  1.  

#Reboot using this mirror to test. Interupt the boot process and select HA Alternate device to boot. Exit scirptlog if reboot cannot be scheduled immediately.

 

#Step 15

shutdown -ry 0 #Recommended. Interupt boot and select the HA Alternate (or alternate, if third mirror) to boot.

 

#OR

 

exit

 

No comments:

Post a Comment