Monday, May 25, 2009

Patch removal when system can only boot from alternate media (cdrom, network).... patchrm -R

When installing system or kernel related patches, its strongly recommends that it should be carried out in single-user mode (run level S). Its also common that certain patch required a Special Install Instruction which must be follows. Neglected the direction may rendered the system unbootable, either panicking in a loop or dropping to an OK prompt. However in a rare circumstances, even have follow the install direction, there is a possibility that patch installation (patchadd) get failed, partially installed or in-completed, and leave server unbootable.

Now the decision is to uninstall (back out) the problematic patch. Since the server unbootable, it need to boot up from alternate media such as cdrom or network, and then remove the patch through patchrm -R.

Following is steps for removal patch when server can not boot from its bootdisk;
Assumed the server have /, /var, and /usr filesystem on separate disk slices.
1. Boot from alternate media or the network.
ok> boot cdrom -s (boot net -s)
2. Mount the root file system and any other required file systems.
# mount /dev/dsk/c0t0d0s0 /a
# mount /dev/dsk/c0t0d0s3 /a/var
# mount /dev/dsk/c0t0d0s4 /a/usr


In case that filesystem can not be mount, it may need run fsck for integrity check.
# fsck /dev/rdsk/c0t0d0s0
# mount /dev/dsk/c0t0d0s0 /a


After all necessary file systems have been mounted, the next step is to uninstall or remove the patch:
# patchrm -R /a (patch number)

Done. The server may now bootable.

With similar scenario, we also able to install patches to server which boot from alternate media. The command; patchadd -R. This is the way Solaris liveupdate and Jumpstart Enterprise Toolkit (JET) update such patches.

Note:
If bootdisk was mirroring (either by Solaris Volume Manager or Veritas Volume Manager), its recommended to break the mirror and then patch only one of the sub-mirror disk. If a problem occurred, it should be possible to boot from the other sub-mirror (the unpatched sub-mirror disk).


No comments:

Post a Comment