Linux menu

Saturday, September 20, 2014

Solaris 11 OS Patching with SVM



In this article we are going to discussing about Installing Solaris OS Patch bundle with SVM (Solaris Volume Manager) control root disk. We  have "Traditional" and "Live Upgrade" patching methods in Solaris 10. Now we are going to see example of Traditional patching method; Live upgrade method will be the next post. Before Patching, requested you to prepare the prerequisites as mentioned below.


Prerequisites :-
1. Download the Latest Patch Bundle.
2. Ensured the Server OS FULL backup.
3. Take Current System Configuration files (CFG2HTML/SUNWexplo)
4. Check the Console Access.
5. Check the Server's hardware health.
6. Application/DBTeam Contacts details.
7. Escalation Procedures
8. Vendor Contact details

High level Plan:-
1. Copy the Current System Configuration files.
2. Freeze the System Monitoring
3. Ensured Application/Databases are brought down.
4. Detach the SVM root Mirror disk (Secondary disk)
5. Mount the rootmirror disk and remove the SVM entries (/etc/vfstab, /etc/System).
6. Reboot the server with Secondary disk to confirm the Rollback prospective.
7. Once it confirmed, Boot the server with Primary disk and start the Installation Process.
8. Once its done, Attach the secondary disk
Rollback Plan:-
1. Boot the server with secondary disk and do the SVM mirror.

Metadevices
/dev/md/dsk/d0   /
/dev/md/dsk/d3   /export/home
/dev/md/dsk/d1   /swap

SVM Configurations
bash-3.00# uname -a
SunOS unixrock 5.10 Generic_142910-17 i86pc i386 i86pc
bash-3.00#
bash-3.00#
bash-3.00# metastat -p
d1 -m d11 d21 1
d11 1 1 c1t0d0s1
d21 1 1 c1t1d0s1
d3 -m d13 d23 1
d13 1 1 c1t0d0s3
d23 1 1 c1t1d0s3
d0 -m d10 d20 1
d10 1 1 c1t0d0s0
d20 1 1 c1t1d0s0
bash-3.00#
Let we start the Installation process. Before that we have to identify which one is primary and secondary disk.
To finding our test server's bootpath (applicable only X86)
bash-3.00# grep bootpath /boot/solaris/bootenv.rc
setprop bootpath /pci@0,0/pci15ad,1976@10/sd@0,0:a
bash-3.00#
bash-3.00# echo |format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c1t1d0 
          /pci@0,0/pci15ad,1976@10/sd@1,0
       2. c1t2d0 
          /pci@0,0/pci15ad,1976@10/sd@2,0
Specify disk (enter its number): Specify disk (enter its number):
bash-3.00#
bash-3.00# df -h /
Filesystem             size   used  avail capacity  Mounted on
/dev/md/dsk/d0         6.9G   5.3G   1.5G    79%    /
bash-3.00# metastat d0
d0: Mirror
    Submirror 0: d10
      State: Okay
    Submirror 1: d20
      State: Okay
    Pass: 1
    Read option: roundrobin (default)
    Write option: parallel (default)
    Size: 14635008 blocks (7.0 GB)

d10: Submirror of d0
    State: Okay
    Size: 14635008 blocks (7.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t0d0s0          0     No            Okay   Yes


d20: Submirror of d0
    State: Okay
    Size: 14635008 blocks (7.0 GB)
    Stripe 0:
        Device     Start Block  Dbase        State Reloc Hot Spare
        c1t1d0s0          0     No            Okay   Yes


Device Relocation Information:
Device   Reloc  Device ID
c1t0d0   Yes    id1,sd@n6000c2914b4078895257c30b73ea38ea
c1t1d0   Yes    id1,sd@n6000c29ec6edd4f3385d43a3f3bb4387
bash-3.00#
According to the above outputs, we confirmed that our Primary Disk is c1t0d0 and Secondary Disk is c1t1d0.
let start Detaching the SVM root Mirror disk (Secondary disk)
bash-3.00# metadetach d0 d20
d0: submirror d20 is detached
bash-3.00#
bash-3.00# metadetach d1 d21
d1: submirror d21 is detached
bash-3.00#
bash-3.00# metadetach d3 d23
d3: submirror d23 is detached
bash-3.00#

Running FSCK on Secondary disk
bash-3.00# fsck -y /dev/rdsk/c1t1d0s0
** /dev/rdsk/c1t1d0s0
** Last Mounted on /mnt
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
187441 files, 4524883 used, 2674586 free (5114 frags, 333684 blocks, 0.1% fragmentation)
bash-3.00#

Mount the Secondary disk and copying the configuration files
bash-3.00# mount /dev/dsk/c1t1d0s0 /mnt
bash-3.00#
bash-3.00# cp /mnt/etc/vfstab /mnt/etc/vfstab_backup
bash-3.00# cp /mnt/etc/system /mnt/etc/system_backup
bash-3.00#

Editing vfstab and System files
bash-3.00# vi /mnt/etc/vfstab
#/dev/md/dsk/d1  -       -       swap    -       no      -
#/dev/md/dsk/d0  /dev/md/rdsk/d0 /       ufs     1       no      -
#/dev/md/dsk/d3  /dev/md/rdsk/d3 /export/home    ufs     2       yes     -
/dev/dsk/c1t1d0s1       -       -       swap    -       no      -
/dev/dsk/c1t1d0s0       /dev/rdsk/c1t1d0s0      /       ufs     1       no      -
/dev/dsk/c1t1d0s3       /dev/rdsk/c1t1d0s3      /export/home    ufs     2       yes     -
"/mnt/etc/vfstab" 13 lines, 452 characters
bash-3.00#
bash-3.00#
bash-3.00# vi /mnt/etc/system
* Begin MDD root info (do not edit)
* rootdev:/pseudo/md@0:0,0,blk
* End MDD root info (do not edit)
"/mnt/etc/system" 102 lines, 2590 characters
bash-3.00#
Umount /mnt and Reboot the server with Secondary disk (c1t1d0s0) to confirm the Rollback prospective.
Once it confirmed, Boot the server with Primary disk (c1t0d0s0) in Single User Mode and start the Installation Process.
bash-3.00# pwd
/var/tmp/patchbundle/10_x86_0113_patchset
bash-3.00# ./installpatchset --dapku

Setup ........


Solaris 10 1/13 (Update 11) Patchset x86

The patch set will complete installation in this session. No intermediate
reboots are required.

Application of patches started : 2014.01.15 19:07:35

Applying 120901-03 (  1 of 700) ... skipped
Applying 121334-04 (  2 of 700) ... skipped
Applying 119255-88 (  3 of 700) ... skipped
Applying 119318-01 (  4 of 700) ... skipped
Applying 121297-01 (  5 of 700) ... skipped
Applying 138216-01 (  6 of 700) ... skipped
Applying 147062-01 (  7 of 700) ... skipped
above Outputs are truncated.......Once Patching is completed, Recommended to reboot the server. In order to take effect the Latest Patch level.
bash-3.00# uname -a
SunOS unixrock 5.10 Generic_142910-17 i86pc i386 i86pc
bash-3.00#
Cool....!!!!...We have successfully completed the OS patching. Monitor for few days, if everything is going fine, we can go for the attaching  the Secondary Devices.

Attaching the Metadevice
bash-3.00# metattach d0 d20
d0: submirror d20 is attached
bash-3.00#
bash-3.00# metattach d1 d21
d1: submirror d21 is attached
bash-3.00#
bash-3.00# metattach d3 d23
d3: submirror d23 is attached
bash-3.00# 
Checking Resync status
bash-3.00# metastat |grep -i %
    Resync in progress: 42 % done
    Resync in progress: 33 % done
    Resync in progress: 10 % done
bash-3.00#
Once Resync is completed, we are successfully completed whole patching activities. Thanks for reading this post, if you have any doubt, please leave your comment, I will get back to you at earliest possible.....!!!!!

No comments: