{"id":223,"date":"2010-04-27T13:48:25","date_gmt":"2010-04-27T05:48:25","guid":{"rendered":"http:\/\/www.sysadmindayph.com\/blog\/?p=223"},"modified":"2010-04-27T13:48:25","modified_gmt":"2010-04-27T05:48:25","slug":"solaris-kernel-patching-recommended-patch","status":"publish","type":"post","link":"http:\/\/www.sysadmindayph.com\/blog\/solaris-kernel-patching-recommended-patch\/","title":{"rendered":"Solaris Kernel Patching Recommended Patch"},"content":{"rendered":"<p>Here&#8217;s another Kernel patching of Solaris. I know there are tons of this type of post in the internet but another reference for the one who needs it, is I guess ok.<\/p>\n<p>To be honest, this is the steps that really made me understood the steps and procedure and the concept behind the 10_Recommended patch for solaris kernel.<\/p>\n<p><!--more--><\/p>\n<p>So, here it is:<\/p>\n<p><strong>Check Boot Disk<\/strong><\/p>\n<p>This step is to check which disks are the member of the boot mirror. We can say that this is the check disk mirror \/ disk membership step<\/p>\n<p><code><br \/>\n# df -h \/<br \/>\nFilesystem             size   used  avail capacity  Mounted on<br \/>\n\/dev\/md\/dsk\/d0          33G   7.3G    25G    23%    \/<br \/>\n#<br \/>\n# metastat -c d0<br \/>\nd0               m   33GB d10 d20<br \/>\n    d10          s   33GB c1t0d0s0<br \/>\n    d20          s   33GB c1t1d0s0<\/p>\n<p><\/code><\/p>\n<p>As you can see, there are two disk that comprise the boot mirror (d0), 33GB c1t0d0s0 and c1t1d0s0, which is named d10 and d20 respectively<\/p>\n<p><strong>Check which disk is booting up<\/strong><\/p>\n<p>In this step, we will determine which of the disk are the one being use as the boot default boot disk.<\/p>\n<p>Usually it&#8217;s the default &#8216;disk&#8217; or &#8216;disk0&#8217;, but there are times, very rare, that &#8216;disk1&#8217; is set as the default boot disk.<\/p>\n<p>To know which disk is the one that boot up the system, you can use the eeprom command in the system shell:<\/p>\n<p><code><br \/>\n# eeprom boot-device<br \/>\nboot-device=disk0<br \/>\n<\/code><\/p>\n<p>In this case, it&#8217;s the most common disk that is used as the boot disk &#8211; disk0. That means, when can detach the other disk as backup just in case the patching screw up.<\/p>\n<p><strong>Check The Bootability of the Backup Disk<\/strong><\/p>\n<p>Prior to patching, check if the other disk is booting. This is a precaution. Just in case the patching went sour, we know that we can always revert to a good disk, revert to the previous good booting condition of the server.<\/p>\n<p>Since from the previous step, we know that the default boot disk is &#8216;disk0&#8217;, we will switch to &#8216;disk1&#8217; and try to reboot the server and see if it will come up.<\/p>\n<p>Now, there are two ways to set the value of the &#8216;boot-device&#8217; paramter of the server. You can either set it at the system shell, or through the Boot PROM, depending on where you are at the moment.<\/p>\n<p>Now, set the default boot disk to &#8216;disk1&#8217;<\/p>\n<p><code><a href=\"http:\/\/docs.sun.com\/app\/docs\/doc\/819-2379\/bootdevice-change?a=view\">eeprom boot-device=disk1<\/a><\/code><\/p>\n<p>or<\/p>\n<p><code><a href=\"http:\/\/docs.sun.com\/app\/docs\/doc\/805-7228\/6j6q7uepp?a=view\">set boot-device=disk1<\/a><\/code><\/p>\n<p>After setting it up, reboot the server:<\/p>\n<p>init 0 then boot <\/p>\n<p>or <\/p>\n<p>init 6<\/p>\n<p>If you&#8217;re successfull, you just  booted on the &#8216;other half&#8217; of the bootdisk.<\/p>\n<p>Now, don&#8217;t forget to switch back to disk0 !!!<\/p>\n<p>Next, (optional&#8230; can differ from company to company)<\/p>\n<p><code># untar the patch file<br \/>\ncd \/var\/tmp<br \/>\nrm -rf PatchDir<br \/>\nmkdir PatchDir<br \/>\nmv S10KernelUpdate4.0.tar.gz PatchDir<br \/>\ncd PatchDir<br \/>\ngunzip -c S10KernelUpdate4.0.tar.gz|tar xf -<\/code><\/p>\n<p><strong>Splitting the Mirror<\/strong><\/p>\n<p>The next steps are the meat of the procedure. This is the patching of the kernel itself.. But of course, after checking the boot disk &#8211; whether the both disks are good- it&#8217;s time to break the mirror and patch one disk.<\/p>\n<p>sync;metadeatch<\/p>\n<p>detach the backup disk<\/p>\n<p>metadetach d0 d20<\/p>\n<p># mount the detached root file system to root and modify these<\/p>\n<p>mount \/dev\/dsk\/c1t1d0s0 \/mnt<\/p>\n<p>vi \/mnt\/etc\/vfstab<br \/>\nvi \/mnt\/etc\/system<\/p>\n<p>Modifying vsfstab and \/etc\/system of the detached disk will make sure that if the patching fail, we can alyas boot up to the backup disk.<\/p>\n<p><strong>Start Patching<\/strong><\/p>\n<p># go to single user mode<br \/>\nsync;sync;init 0<\/p>\n<p>init -s<\/p>\n<p>Rebooting with command: boot -s<br \/>\nBoot device: \/pci@8,600000\/SUNW,qlc@4\/fp@0,0\/disk@0,0  File and args: -s<br \/>\nSunOS Release 5.10 Version Generic_141414-02 64-bit<br \/>\nCopyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.<br \/>\nUse is subject to license terms.<\/p>\n<p>&#8230; You then follow the ReadMe document that comes with the Patch here.<\/p>\n<p>Once the patching is done, you&#8217;ll see the difference of the patch level of the kernel.<\/p>\n<p>Boot device: disk0  File and args:<br \/>\nSunOS Release 5.10 Version Generic_<strong>142900<\/strong>-02 64-bit<br \/>\nCopyright 1983-2009 Sun Microsystems, Inc.  All rights reserved.<br \/>\nUse is subject to license terms.<\/p>\n<p>Optional<br \/>\n=&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\nFor more installation messages refer to the installation logfile:<br \/>\n  \/var\/sadm\/install_data\/PMGT:_TLP-Set_Solaris_10_SOE_S10KernelUpdate4.1_A1_04_27_10<\/p>\n<p>Use &#8216;\/usr\/bin\/showrev -p&#8217; or &#8216;\/usr\/sbin\/patchadd -p&#8217; to verify<br \/>\ninstalled patch-ids.<br \/>\nRefer to individual patch README files for more patch detail.<br \/>\nRebooting the system is usually necessary after installation.<br \/>\nsvc.startd: The system is coming down.  Please wait.<br \/>\nsvc.startd: 20 system services are now being stopped.<\/p>\n<p>!!! Please read the logfile for any required action before rebooting !<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>reboot:! for the bank, it&#8217;s automatic<\/p>\n<p>If all is good, you can reattach the other disk<\/p>\n<p>metattach d0 d20<\/p>\n<p>And you&#8217;re done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s another Kernel patching of Solaris. I know there are tons of this type of post in the internet but another reference for the one who needs it, is I guess ok. To be honest, &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,5,25,36],"tags":[344,345,348,347,346],"class_list":["post-223","post","type-post","status-publish","format-standard","hentry","category-operating-system","category-solaris","category-solaris-10","category-tutorial","tag-10_recommended-patch","tag-breaking-mirror","tag-howto-kernel-patch","tag-kernel-patch","tag-solaris-kernel-patching"],"_links":{"self":[{"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/comments?post=223"}],"version-history":[{"count":2,"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/223\/revisions"}],"predecessor-version":[{"id":225,"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/posts\/223\/revisions\/225"}],"wp:attachment":[{"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/media?parent=223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/categories?post=223"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sysadmindayph.com\/blog\/wp-json\/wp\/v2\/tags?post=223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}