Unix OS Shell script HP-UX 11iv1 Mirror root disk

** Myself
### Add mirror before of creating new logical volumn
#1. Please check the path of primary and secondary disk.
PRI_DISK=c2t0d0
PRI_PATH=0/1/1/0.1.0
SEC_DISK=c2t1d0
SEC_PATH=0/1/1/1.2.0
#2. Check boot and primary disk
lvlnboot -v
#3. Scan secondary disk
ioscan -fnC disk
#4. pvcreate the new disk
pvcreate -B /dev/rdsk/${SEC_DISK}
#5. Use mkboot to place boot utilities inthe boot area,the newly created boot disk
mkboot /dev/rdsk/$SEC_DISK
#6. Use mkboot to set quorum into disk
mkboot  -a  "hpux  -lq"  /dev/rdsk/$SEC_DISK
mkboot  -a  "hpux  -lq"  /dev/rdsk/$PRI_DISK
#7. Extend vg to include new disk
vgextend /dev/vg00 /dev/dsk/${SEC_DISK}
#8. extend lvols to mirror on the disk
for i in /dev/vg00/lv*
do
lvextend -m 1 $i /dev/dsk/${SEC_DISK}
done
#9. Update lvol boot paths
lvlnboot -v
lvlnboot -r /dev/vg00/lvol3 /dev/vg00
lvlnboot -b /dev/vg00/lvol1 /dev/vg00
lvlnboot -s /dev/vg00/lvol2 /dev/vg00
lvlnboot -d /dev/vg00/lvol2 /dev/vg00
#10. Change Boot Path
setboot -p $PRI_PATH
setboot -h $SEC_PATH
setboot -b on
--or-- console
setboot  pri  0/0/…
setboot  alt  0/0/…

0 comments:

Loading