{"id":406,"date":"2016-01-15T17:48:08","date_gmt":"2016-01-15T22:48:08","guid":{"rendered":"http:\/\/www.hpux.ws\/?p=406"},"modified":"2017-01-23T16:57:58","modified_gmt":"2017-01-23T21:57:58","slug":"automated-setboot-check-and-correction","status":"publish","type":"post","link":"https:\/\/www.hpux.ws\/?p=406","title":{"rendered":"Automated setboot check and correction"},"content":{"rendered":"<p>When you use drd to patch and update systems offline to reduce downtime there is an unintended impact: setboot issues.<\/p>\n<p>Using HP best practices after you boot the new image the setboot -a (alternate) and -p (primary) settings are often the same.<\/p>\n<p>Below is an audit and correction script that helps you track the issue and limit manual intervention and the human error it can introduce:<br \/>\nmyserv0:root > cat 349_bootconf<br \/>\n#!\/bin\/ksh<br \/>\n#########################################################################<br \/>\n# default_umask<\/p>\n<p>#HPUX_SCRIPTS=\/opt\/depots\/scripts\/system_build\/HPUX<br \/>\n#COMMON=\/opt\/depots\/scripts\/system_build\/COMMON<br \/>\n# Load common environment<br \/>\n. \/var\/adm\/bin\/.scriptenv<\/p>\n<p>#<br \/>\n# The point here is there should be an a primary boot disk<br \/>\n# and an alternate boot disk and they need to be different<br \/>\n#<br \/>\npboot=$(\/usr\/sbin\/setboot | grep ^Primary | awk &#8216;{ print $NF }&#8217; | awk -F\\\/ &#8216;{print $NF}&#8217; |<br \/>\n awk -F\\) &#8216;{print $1}&#8217;);<br \/>\naboot=$(\/usr\/sbin\/setboot | grep ^Alternate |awk &#8216;{ print $NF }&#8217;|awk -F\\\/  &#8216;{print $NF}&#8217; |<br \/>\n awk -F\\) &#8216;{print $1}&#8217;);<\/p>\n<p>if [ &#8220;$aboot&#8221; = &#8220;$pboot&#8221; ]<br \/>\nthen<br \/>\n  echo &#8220;NOTICE &#8211; ${hn} The primary boot disk ${pboot} is the same as the alternate boot disk ${aboot}&#8221;<br \/>\nelse<br \/>\n  echo &#8220;pass &#8211; The primary boot disk ${pboot} is the different than the alternate boot disk ${aboot}&#8221;<\/p>\n<p>fi<\/p>\n<p>if [ &#8220;$1&#8221; = &#8220;-y&#8221; ];then<br \/>\n        echo &#8220;This may need to be remediated manually.&#8221;<\/p>\n<p>#<br \/>\n# attempt to figure this out in an automated fashion<br \/>\n#<br \/>\n#<br \/>\n# Determine what the boot dg is.<br \/>\n  # Try to use DRD configuration to determine the alt. boot disk and set it.<br \/>\n  > \/tmp\/drdstatus.tfile.txt<br \/>\n  \/opt\/drd\/bin\/drd status -x logfile=\/tmp\/drdstatus.tfile.txt<br \/>\n  CLONE_DISK=$(awk &#8216;\/Clone Disk: \/{ print $NF}&#8217; \/tmp\/drdstatus.tfile.txt | awk  -F\\\/ &#8216;{ print $4  }&#8217; | awk -F\\) &#8216;{ print $1 }&#8217;);<br \/>\n  echo &#8220;Clone disk is ${CLONE_DISK}&#8221;<br \/>\n  setboot -a \/dev\/rdisk\/${CLONE_DISK}<br \/>\nfi<\/p>\n<p>echo &#8220;#### end report $0 ${sn} ####&#8221;<\/p>\n<p>There is an audit script:<\/p>\n<p>myserver0:root > \/var\/adm\/bin\/audit\/349_bootconf<br \/>\nExecuting HP-UX specific environment parameters&#8230;<br \/>\nNOTICE &#8211; The primary boot disk disk1972 is the same as the alternate boot disk disk1972<br \/>\n#### end report \/var\/adm\/bin\/audit\/349_bootconf myserv0 ####<\/p>\n<p>mysys03:root > setboot<br \/>\nPrimary bootpath : 2\/0\/2\/1\/0\/4\/1.0x50060e80166f4202.0x4001000000000000 (\/dev\/rdisk\/disk2490)<br \/>\nHA Alternate bootpath :<br \/>\nAlternate bootpath : 2\/0\/2\/1\/0\/4\/0.0x50060e80166f4212.0x4001000000000000 (\/dev\/rdisk\/disk2490)<\/p>\n<p>Autoboot is ON (enabled)<br \/>\nHyperthreading : ON<br \/>\n               : ON (next boot)\t<\/p>\n<p>This is wrong but is a known issue that results from my patch methodology<\/p>\n<p>First step to fixing is to confirm current booted details and drd details<\/p>\n<p>mysys03:root > lvlnboot -v<br \/>\nBoot Definitions for Volume Group \/dev\/vg00:<br \/>\nPhysical Volumes belonging in Root Volume Group:<br \/>\n        \/dev\/disk\/disk2490_p2 &#8212; Boot Disk<br \/>\nBoot: lvol1     on:     \/dev\/disk\/disk2490_p2<br \/>\nRoot: lvol3     on:     \/dev\/disk\/disk2490_p2<br \/>\nSwap: lvol2     on:     \/dev\/disk\/disk2490_p2<br \/>\nDump: lvol2     on:     \/dev\/disk\/disk2490_p2, 0<\/p>\n<p>lvlnboot: Volume group not activated.<br \/>\nCannot display volume group &#8220;\/dev\/vgAP1&#8221;.<br \/>\nlvlnboot: Volume group not activated.<br \/>\nCannot display volume group &#8220;\/dev\/vgsapAP1&#8221;.<br \/>\nmysys03:root > cat \/var\/adm\/bin\/drd_data<br \/>\nDISK1=\/dev\/disk\/disk2490<br \/>\nDISK2=\/dev\/disk\/disk1951<br \/>\nmysys03:root > drd status<\/p>\n<p>=======  01\/14\/16 14:15:17 PST  BEGIN Displaying DRD Clone Image Information<br \/>\n         (user=root)  (jobid=mysys03)<\/p>\n<p>       * Clone Disk:               \/dev\/disk\/disk1951<br \/>\n       * Clone EFI Partition:      AUTO file present, Boot loader present<br \/>\n       * Clone Rehost Status:      SYSINFO.TXT not present<br \/>\n       * Clone Creation Date:      01\/07\/16 15:00:27 PST<br \/>\n       * Last Sync Date:           None<br \/>\n       * Clone Mirror Disk:        None<br \/>\n       * Mirror EFI Partition:     None<br \/>\n       * Original Disk:            \/dev\/disk\/disk2490<br \/>\n       * Original EFI Partition:   AUTO file present, Boot loader present<br \/>\n       * Original Rehost Status:   SYSINFO.TXT not present<br \/>\n       * Booted Disk:              Original Disk (\/dev\/disk\/disk2490)<br \/>\n       * Activated Disk:           Original Disk (\/dev\/disk\/disk2490)<\/p>\n<p>=======  01\/14\/16 14:15:40 PST  END Displaying DRD Clone Image Information<br \/>\n         succeeded. (user=root)  (jobid=mysys03)<br \/>\nFix is currently manual<\/p>\n<p>mysys03:root > setboot -a \/dev\/rdisk\/disk1951<br \/>\nAlternate boot path set to 2\/0\/2\/1\/0\/4\/0.0x50060e80166f4212.0x4000000000000000 (\/dev\/rdisk\/disk1951)<br \/>\nmysys03:root > setboot<br \/>\nPrimary bootpath : 2\/0\/2\/1\/0\/4\/1.0x50060e80166f4202.0x4001000000000000 (\/dev\/rdisk\/disk2490)<br \/>\nHA Alternate bootpath :<br \/>\nAlternate bootpath : 2\/0\/2\/1\/0\/4\/0.0x50060e80166f4212.0x4000000000000000 (\/dev\/rdisk\/disk1951)<\/p>\n<p>Autoboot is ON (enabled)<br \/>\nHyperthreading : ON<br \/>\n               : ON (next boot)<\/p>\n<p>Possible automated fix (needs to be verified manually first use).<\/p>\n<p>mysys00:root > .\/349_bootconf -y<br \/>\nExecuting HP-UX specific environment parameters&#8230;<br \/>\nNOTICE &#8211; The primary boot disk disk1972 is the same as the alternate boot disk disk1972<br \/>\nThis may need to be remmediated manually.<\/p>\n<p>=======  01\/14\/16 14:43:22 PST  BEGIN Displaying DRD Clone Image Information<br \/>\n         (user=root)  (jobid=aappch0)<\/p>\n<p>       * Clone Disk:               \/dev\/disk\/disk2236<br \/>\n       * Clone EFI Partition:      AUTO file present, Boot loader present<br \/>\n       * Clone Rehost Status:      SYSINFO.TXT not present<br \/>\n       * Clone Creation Date:      01\/14\/16 14:00:36 PST<br \/>\n       * Last Sync Date:           None<br \/>\n       * Clone Mirror Disk:        None<br \/>\n       * Mirror EFI Partition:     None<br \/>\n       * Original Disk:            \/dev\/disk\/disk1972<br \/>\n       * Original EFI Partition:   AUTO file present, Boot loader present<br \/>\n       * Original Rehost Status:   SYSINFO.TXT not present<br \/>\n       * Booted Disk:              Original Disk (\/dev\/disk\/disk1972)<br \/>\n       * Activated Disk:           Original Disk (\/dev\/disk\/disk1972)<\/p>\n<p>=======  01\/14\/16 14:43:45 PST  END Displaying DRD Clone Image Information<br \/>\n         succeeded. (user=root)  (jobid=aappch0)<\/p>\n<p>Clone disk is disk2236<br \/>\nAlternate boot path set to 3\/0\/4\/0\/0\/0\/0\/4\/0\/0\/1.0x50060e80166f4273.0x4001000000000000 (\/dev\/rdisk\/disk2236)<br \/>\n#### end report .\/349_bootconf aappch0 ####<br \/>\nmyserv0:root > .\/349_bootconf<br \/>\nExecuting HP-UX specific environment parameters&#8230;<br \/>\nPass &#8211; The primary boot disk disk1972 is the different than the alternate boot disk disk2236<br \/>\n#### end report .\/349_bootconf aappch0 ####<br \/>\nmyserv0:root > setboot<br \/>\nPrimary bootpath : 3\/0\/6\/0\/0\/0\/0\/4\/0\/0\/0.0x50060e80166f4213.0x4000000000000000 (\/dev\/rdisk\/disk1972)<br \/>\nHA Alternate bootpath :<br \/>\nAlternate bootpath : 3\/0\/4\/0\/0\/0\/0\/4\/0\/0\/1.0x50060e80166f4273.0x4001000000000000 (\/dev\/rdisk\/disk2236)<\/p>\n<p>Autoboot is ON (enabled)<br \/>\nHyperthreading : ON<br \/>\n               : ON (next boot)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you use drd to patch and update systems offline to reduce downtime there is an unintended impact: setboot issues. Using HP best practices after you boot the new image the setboot -a (alternate) and -p (primary) settings are often the same. Below is an audit and correction script that helps you track the issue [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-406","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/406"}],"collection":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406"}],"version-history":[{"count":0,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}