Home > Hardware, IT Architecture, Storage, Systems, Unix > Solaris patching trick – first patch submirror, then sync between mirrors

Solaris patching trick – first patch submirror, then sync between mirrors

April 17th, 2011

The main idea of this solution is that, we firstly patch submirror of solaris, and then sync between mirrors. This way, we prevent failure on the patching by sync only after the submirror patch succeed.

d0 is root metadevice
d3 is /var metadevice
d10 is c1t0d0s0
d20 is c1t1d0s0
d13 is c1t0d0s3
d23 is c1t1d0s3

- flush FS cache to disk
# sync; sync: sync

-keep a note of all disks with command format. You'll need the info later:

AVAILABLE DISK SELECTIONS:
0. c1t0d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1c,600000/scsi@2/sd@0,0
1. c1t1d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1c,600000/scsi@2/sd@1,0
2. c1t2d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1c,600000/scsi@2/sd@2,0
3. c1t3d0 <SUN72G cyl 14087 alt 2 hd 24 sec 424>
/pci@1c,600000/scsi@2/sd@3,0

- detach root metadevice submirror
# metadetach d0 d20

- detach /var metadevice submirror
# metadetach d3 d23

- fsck detached submirrors
# fsck -F ufs /dev/rdsk/c1t1d0s0
# fsck -F ufs /dev/rdsk/c1t1d0s3

- mount detached submirrors in /a mountpoint
# mkdir /a
# mount /dev/dsk/c1t1d0s0 /a && mount /dev/dsk/c1t1d0s3 /a/var

- update mounted rootmirror vfstab and system files
vi /a/etc/vfstab
Change / and /var to mount the rootmirror slices instead of the metadevices(because metadevices are detached already)

vi /a/etc/system and remove the following lines
* Begin MDD root info (do not edit)
rootdev:/pseudo/md@0:0,0,blk
* End MDD root info (do not edit)

- start patching
# cd /var/patches/10_PC
# ./installcluster -R /a –apply-prereq –s10cluster
# nohup ./installcluster -R /a –s10cluster > install_cluster.log 2>&1 &

- monitor patching process
while true
do
grep -n `awk ‘/^Installing/ {print substr($2,1,9)}’ install_cluster.log | tail -1` patch_order_10_Recommended
sleep 60
done

- boot off patched submirrors
# to ease recovery in case of issues – temporarily set the following OBP values;
eeprom “auto-boot?=false”
eeprom “boot-device=rootmirror rootdisk” #boot from patched mirror, if fails, will boot from unpatched one.

/a/boot/solaris/bin/create_ramdisk -R /a
umount /a/var
umount /a

fsck -F ufs /dev/rdsk/c1t1d0s0
fsck -F ufs /dev/rdsk/c1t1d0s3

reboot #boot from d20, the patched mirror
NOTE:reboot successfully, checked uname -a, version updated.

- If happy with the results – the following process should be followed to make the newly patched sub-mirrors the new boot environment.

metaclear d20
metaclear d23
metaclear -r d0
metaclear -r d3

metainit -f d20 1 1 c1t1d0s0
metainit -f d23 1 1 c1t1d0s3
metainit d0 -m d20
metainit d3 -m d23

metaroot d0 #boot from the patched mirror

vi /etc/vfstab and update the line for /var filesystem to mount the d3 metadevice instead of the rootmirror slice

# update the rootdisk /etc/vfstab and /etc/system files so that we can still get back to the non-patched version of the O/S easily. i.e.

fsck -F ufs /dev/rdsk/c1t0d0s0
fsck -F ufs /dev/rdsk/c1t0d0s3

mkdir -p /a
mount /dev/dsk/c1t0d0s0 /a
mount /dev/dsk/c1t0d0s3 /a/var

vi /a/etc/vfstab
Change / and /var to mount the rootdisk slices instead of the metadevices #c1t0d0s0 and c1t0d0s3

vi /a/etc/system and remove the following lines
* Begin MDD root info (do not edit)
rootdev:/pseudo/md@0:0,0,blk
* End MDD root info (do not edit)

sync ; sync ; sync

umount /a/var
umount /a

init 6 #boot from d0

- if everything is ok, reattach old rootdisk:

metainit d10 1 1 c1t0d0s0
metainit d13 1 1 c1t0d0s3

metattach d0 d10 #will sync d10 d20
metattach d3 d13 #will sync d13 d23

# reset the OBP settings back to the normal values;
eeprom “auto-boot?=true”
eeprom “boot-device=rootdisk rootmirror”

then, alter kernel params as per EMC recommendations:

vi /etc/system

Must add “set sd:sd_io_time=60″, “set sd:sd_max_throttle=20″, “set ssd:ssd_io_time=60″, and “set ssd:ssd_max_throttle=20″ in the /etc/system file for Symmetrix or CLARiiON attach. Do not include quotes on these entries.

and reboot #reboot from synced rootdisk c1t0d0s0

Problem resolved?


Categories: Hardware, IT Architecture, Storage, Systems, Unix Tags:
  1. No comments yet.
  1. No trackbacks yet.