Sie sind auf Seite 1von 4

How to Patch a Live System Mirrored with SVM on x86 The main purpose of this technical note is to demonstrate

how to patch a running (live) system currently mirrored using SVM on a x86 machine, minimizing the downtime as far as possible. The idea is simple: detach one side of the mirror, apply the cluster patch against it and reboot on it. If all seems OK, re-encapsulate the system. This can achieve similar goal currently found in the Live Upgrade feature of the Solaris OS (see live_upgrade(5)), with less complexity and different requirement (LVM RAID-1 vs. spare disk, or free slice). Using this solution, the downtime can go between 10 to 30 minutes of service unavailability (depending on the hardware POST) and a maximum of two reboots are required, whatever is the number of patches to apply. TAKE the explorer of the machine before proceeding with patch process # metastat -p d0 -m d10 d11 1 d10 1 1 c1d0s0 d11 1 1 c2d0s0 d7 -m d70 d71 1 d70 1 1 c1d0s7 d71 1 1 c2d0s7 d5 -m d50 d51 1 d50 1 1 c1d0s5 d51 1 1 c2d0s5 d2 -m d20 d21 1 d20 1 1 c1d0s1 d21 1 1 c2d0s1 # # cat /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # fd /dev/fd fd no /proc /proc proc no /dev/md/dsk/d3 swap no /dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no /dev/md/dsk/d1 /dev/md/rdsk/d1 /var ufs 1 no swap /tmp tmpfs yes Run an explorer and generate a cluster patch, based on tools provided by the OSE for example, if you are luckily enough to have one included with your support plan (or just pick one provided at SunSolve).

Then, be sure to be able to boot on the two disks, just in case: # /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s0 # /sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c2d0s0 The next step is to voluntarily detach one side of the mirror: Take the second one i.e. c2d1s0). Note: Edit /boot/grub/menu.lst file to make entry for Alternate Boot Environment. ******************************************* title Alternate boot Solaris 10 root(hd1,0,a) kernel /platform/i86pc/multiboot module /platform/i86pc/boot_archive

# lockfs -af /* Just to minimize the fs inconsistencies at next fsck(1m). */ # # metadetach d0 d11 # metadetach d7 d71 # metadetach d5 d51 # metadetach d2 d21 # metaclear d21 # metaclear d11 # metaclear d51 # metaclear d71 Check and repair the file systems if necessary, since we will boot on them the next time: # fsck /dev/rdsk/c2d0s0 # fsck /dev/rdsk/ c2d0s5 # fsck /dev/rdsk/ c2d0s7 Next steps include mounting the recently detached file systems and prepare the second disk to boot without SVM encapsulation: # mkdir /mirror # mount /dev/dsk/c2d0s0 /mirror # mount /dev/dsk/c2d0s5 /mirror/opt # mount /dev/dsk/c2d0s7 /mirror/home Change the /mirror/etc/vfstab to bring in Slice mode. # cat /mirror/etc/vfstab #device device #to mount to fsck mount point FS type fsck mount mount pass at boot options

# fd /dev/fd fd no /proc /proc proc no /dev/dsk/c2d0s1 swap no /dev/dsk/c2d0s0 /dev/rdsk/c2d0s0 / ufs 1 no /dev/dsk/c2d0s7 /dev/rdsk/c2d0s7 /home ufs 2 yes /dev/dsk/c2d0s5 /dev/rdsk/c2d0s5 /opt ufs 2 yes /devices /devices devfs no sharefs /etc/dfs/sharetab sharefs no ctfs /system/contract ctfs no objfs /system/object objfs no swap /tmp tmpfs yes # cp /mirror/etc/system /mirror/etc/system.orig # sed -e 's;rootdev:/pseudo/md@0:0,0,blk;*rootdev:/pseudo/md@0:0,0,blk;' \ /mirror/etc/system.orig > /mirror/etc/system Last, install patches against the second disk, clean things up a little and reboot if the install procedure went all smooth: # ./installcluster --apply-prereq --s10cluster (PLEASE execute this only if specified in PATCH README file) # cp /mirror/etc/zones/index /mirror/etc/zones/index.23Feb2011 (PLEASE execute this only if specified in PATCH README file) # ./install_all_patches -R /mirror # # # shutdown -y -g0 -i6 NOTE: Dont umount the /mirror filesystem as the Boot_archive on this disk has to be updated during reboot. NOTE: During Reboot please select Alternate boot Solaris 10 from GRUB Menu to boot from Patched disk. After rebooting, carefully review the behavior of the very freshly patched system. If all seems well, don't forget to re-encapsulate the other disk. Here is a quick and easy way to this: /* Clean the system metadevices always present. */ # metaclear r d0 # metaclear r d2 # metaclear r d5 # metaclear r d7 /* Recreate the metadb. */

# metadb -d c2d0s4 c1d0s4 # metadb -a c2 -f c2d0s4 c1d0s4 # /* Re-create them as part of a mirror. */ # metainit -f d11 1 1 c2d0s0 # metainit d0 -m d11 # metainit -f d21 1 1 c2d0s1 # metainit d2 -m d21 # metainit -f d51 1 1 c2d0s5 # metainit d5 -m d51 # metainit -f d71 1 1 c2d0s7 # metainit d7 -m d71

/* Be able to boot on the new metadevices. */ # metaroot d0 NOTE:Don't forget to edit /etc/vfstab in order to reflect the other metadevices: * s@/dev/dsk/cXtYdZsN@/dev/md/dsk/dN@ * s@/dev/rdsk/cXtYdZsN@/dev/md/rdsk/dN@ /* Reboot, and create the second side of the mirror. */ # shutdown -y -g 0 -i 6 [...] # metainit -f d10 1 1 c1d0s0 # metattach d0 d10 # metainit -f d20 1 1 c1d0s1 # metattach d2 d20 # metainit -f d50 1 1 c1d0s5 # metattach d5 d50 # metainit -f d70 1 1 c1d0s7 # metattach d7 d70 Check system dump configuration.