<

Go Premium for a chance to win a PS4. Enter to Win

x

Live Patching for the Solaris 9 Operating System

Published on
9,599 Points
3,399 Views
2 Endorsements
Last Modified:
Introduction
Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine is slow.
Recently, I used the Live Upgrade tools in the Solaris OS to successfully apply the latest patch cluster to a machine running the Solaris 9 OS, without bringing the machine into single-user mode.


Preparation
Before you can do live patching, you need an extra boot disk. I used an 18 Gbyte disk for this test. Also, the following necessary packages and patch revisions need to be installed on the system:
a) Required packages for the Solaris 9 release:
  SUNWadmap
  SUNWlur
  SUNWluu
b) Patches needed for the Solaris 9 OS of SPARC Platforms.


Procedure
The machine I'm using has a 72 Gbyte internal disk with the Solaris 9 OS installed on it.
The current partition table on the 72 Gbyte disk is:

  Filesystem kbytes used avail capacity Mounted on
   /dev/dsk/c5t0d0s0 6559565 92604 6401366 2% /
   /dev/dsk/c5t0d0s1 1988887 799593 1129628 42% /usr
   /proc 0 0 0 0% /proc
   fd 0 0 0 0% /dev/fd
   mnttab 0 0 0 0% /etc/mnttab
   /dev/dsk/c5t0d0s4 10086988 846725 9139394 9% /var
   swap 7081544 32 7081512 1% /var/run
   /dev/dsk/c5t0d0s5 20174761 5315024 14657990 27% /opt


I'm using another 18 Gbyte disk for installing the new boot environment and patching.
The new partition table on the 18 Gbyte disk is:

 Current partition table (original):
   Total disk cylinders available: 7506 + 2 (reserved cylinders)

   Part Tag Flag Cylinders Size Blocks
     0 root wm 0 - 217 501.57MB (218/0/0) 1027216
     1 swap wu 218 - 869 1.46GB (652/0/0) 3072224
     2 backup wm 0 - 7505 16.86GB (7506/0/0) 35368272
     3 usr wm 870 - 1739 1.95GB (870/0/0) 4099440
     4 var wm 1740 - 3565 4.10GB (1826/0/0) 8604112
     5 home wm 3566 - 6956 7.62GB (3391/0/0) 15978392
     6 home wm 6957 - 7499 1.22GB (543/0/0) 2558616
     7 home wm 7500 - 7503 9.20MB (4/0/0) 18848


Here are the steps required for this procedure.
1) Create a new boot environment as below:

   # lucreate -c s9old -n s9new -m /:c5t2d0s0:ufs -m -:c5t2d0s1:swap -m
   /usr:c5t2d0s3:ufs -m /var:c5t2d0s4:ufs -m /opt:c5t2d0s5:ufs


I created /, /usr, /var, and /opt for the purpose of applying patches. However, if you want to boot up from the new disk only, every file system on the current boot disk has to move across, like swap in this case.
2) The creation of a new boot environment (s9new) is successful. Mount all file systems in the boot environment for applying patches:

   # lumount s9new

The /, /usr, /var, and /opt directories will be mounted to the alternate mount points. You can confirm this from the output of the df -k command as follows:

   Filesystem kbytes used avail capacity Mounted on
   /dev/dsk/c5t0d0s0 6559565 92170 6401800 2% /
   /dev/dsk/c5t0d0s1 1988887 799593 1129628 42% /usr
   /proc 0 0 0 0% /proc
   fd 0 0 0 0% /dev/fd
   mnttab 0 0 0 0% /etc/mnttab
   /dev/dsk/c5t0d0s4 10086988 846888 9139231 9% /var
   swap 7072912 32 7072880 1% /var/run
   /dev/dsk/c5t0d0s5 20174761 5315024 14657990 27% /opt
   /dev/dsk/c5t2d0s0 482455 91966 342244 22% /.alt.s8new
   /dev/dsk/c5t2d0s3 1987399 799592 1128186 42% /.alt.s8new/usr
   /dev/dsk/c5t2d0s4 4236302 837743 3356196 20% /.alt.s8new/var
   /dev/dsk/c5t2d0s5 7866417 5315024 2472729 69% /.alt.s8new/opt


3) Now you are ready to apply the Solaris patch cluster that you have prepared. In this case, the patches are in the /var/tmp/patches directory.

   # cd /var/tmp/patches
   # ./install_cluster -R /.alt.s9new


Below is the output from the command:

   Patch cluster install script for Solaris 9 Recommended Patch Cluster

   *WARNING* SYSTEMS WITH LIMITED DISK SPACE SHOULD *NOT* INSTALL PATCHES:
   With or without using the save option, the patch installation process
   will still require some amount of disk space for installation and
   administrative tasks in the /, /usr, /var, or /opt partitions where
   patches are typically installed. The exact amount of space will
   depend on the machine's architecture, software packages already
   installed, and the difference in the patched objects size. To be
   safe, it is not recommended that a patch cluster be installed on a
   system with less than 4 MBytes of available space in each of these
   partitions. Running out of disk space during installation may result
   in only partially loaded patches. Check and be sure adequate disk space
   is available before continuing.

   Are you ready to continue with install? [y/n]: y   <---- answer yes
                                                            here if you
                                                            are ready
   
Use -R to specify an alternative root path (/.alt.s9new in this case), once it is done. You can find the installation messages in the following log file:

/var/sadm/install_data/Solaris_9_Recommended_Patch_Cluster_log

4) Now you have two boot environments (BEs), and you can check the status by the following command:

   # lustatus


Below is the output from the command:

   Boot Environment           Is       Active Active    Can    Copy
   Name                       Complete Now    On Reboot Delete Status
   -------------------------- -------- ------ --------- ------ ----------
   s9old                      yes      yes    yes        no     -
   s9new                      yes      no     no         yes    -


5) Before you can switch to the new BE, you should dismount it.

   # luumount s9new


6) Activate the new BE.

  # luactivate -n s9new


7) Now if you check the BE status again, you can notice the difference in the Active On Reboot column:

   # lustatus


Below is the output from the command:

   Boot Environment           Is       Active Active    Can    Copy
   Name                       Complete Now    On Reboot Delete Status
   -------------------------- -------- ------ --------- ------ ----------
   s9old                      yes      yes    no        no     -
   s9new                      yes      no     yes       no     -


8) Issue a reboot command and watch it boot from the alternate boot environment you created. To confirm this you could use the df -k command and make sure you are booted to the alternate boot environment with the latest patch installed.

  # init 6
  # df -k
2
Comment
Author:Joseph Gan
0 Comments

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Join & Write a Comment

Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month6 days, 5 hours left to enroll

Keep in touch with Experts Exchange

Tech news and trends delivered to your inbox every month