Skip to main content

Solaris10 cleanup /var/sadm. Remove old patches

This document tells you how to recover space in /var, which is used for patch backout data.
It is possible to experience space issues in /var as patch "undo" and "obsolete" data, which is stored for use during patch backout, builds up as more patches are applied to the system.
It is best to plan for this expansion of /var in advance,  and allocate plenty of free space to this partition. 
How much space to allocate to /var depends on a number of variables, such as how many patches are likely to be applied to the system, which is dependent on frequency of patching, strategy of which patches will be applied (all, sun alert, security only, etc.), products patched; whether the system has zones which implies 'pspool' space requirements, etc.
A figure of 10Gb to 20Gb or even more is not unreasonable.
In the Patch System Test lab, we currently have Solaris 10 systems with >7GB used in /var and this will continue to grow over the lifetime of Solaris 10.
If there is insufficient space in /var of an existing system, the recommended solution is to extend the size of the /var partition.
This can be accomplished by backing up /var, creating a bigger /var partition on another disk, restoring the /var backup onto that partition and then updating the /var entry in the /etc/vfstab file.
If /var is part of the "/" (root) partition, then relocating /var to a separate partition would be a good solution.
The relocation process is documented in (Doc ID 1011662.1).
Sun strongly discourages manual modifications to the /var/sadm/pkg directory and its file structure.
That directory structure should only be modified by the Solaris patching and packaging utilities.
Corruption in this directory structure will prevent any future packaging or patching operations.

SOLUTION

Below is information on how to free up space in /var by deleting certain patch related files.
This should only be used when there are no other ways of gaining space in /var.
Having a full and current backup of the OS is highly recommended before deleting files from /var.
It is confirmed that unneeded "obsolete" and "undo" files may be removed from the:
/var/sadm/pkg/<pkg-name>/save/<patch-nr>
and "undo" files from the:
/var/sadm/pkg/<pkg-name>/save/pspool/<pkg-name>/save/<patch-nr>
directories in order to free up space in /var.
This will not invalidate support contracts.
The "undo" files are used during the patch removal process. 
Removing the "undo" files associated with a patch means that it will no longer be possible to uninstall the patch.
Once a later revision of a patch is applied, or a patch which obsoletes a patch is applied, the "undo" files in /var/sadm/pkg/<pkg-name>/save/<patch-nr> are renamed "obsolete.Z" and a file "obsoleted_by" is created.
These "obsolete" files may also be removed.
It is strongly recommended to only remove the "obsolete" and "undo" files for patches which the user is confident will not need to be backed out.
For example rejuvenated Kernel patches associated with Solaris 10 Update releases such as 118833-36 (SPARC) / 118855-36 (x86), 120011-14 (SPARC) / 120012-14 (x86), etc. and other older Kernel patch revisions.
See the sequence of Solaris 10 Kernel PatchIDs listed on https://blogs.oracle.com/patch/date/20080416
As patches containing subsequent fixes to the objects contained in these rejuvenated patches will have a SUNW_REQUIRES dependency on the these rejuvenated patches, it's extremely unlikely that older versions of these rejuvenated Kernel patches will ever be backed out. Therefore, their "undo" files are prime candidates for removal to free up space in /var if required and it's not possible to extend /var.
All the "undo" or "obsolete" files for a particular patch should be removed from the /var/sadm/pkg/<pkg-name>/save/<patch-nr> directories.
For example:
# rm /var/sadm/pkg/*/save/118833-36/undo*
# rm /var/sadm/pkg/*/save/118833-36/obsolete*
The system also keeps a copy of "undo" files for use during creation of new non-global zones. These may also be removed if the customer is confident that the patches will not need to be backed out.
For example:
# rm /var/sadm/pkg/*/save/pspool/*/save/118833-36/undo*
The "undo" files in the pspool directory are not renamed to "obsolete" when a later revision is installed.

Further Information:
The "undo" files are specific to the zone of the system on which they were created during application of a patch by patchadd. Therefore, do not copy the "undo" file from one zone to another or from one system to another.
One could potentially archive the "undo" files for each zone of a system and restore it to that zone if desired.

Comments

Popular posts from this blog

memory error detect XSCF uboot

If you see something like this when you poweron you server: memory error detect 80000008, address 000002d0 data 55555555 -> fbefaaaa capture_data hi fbefaaaa lo deadbeef ecc 1b1b capture_attributes 01113001 address 000002d0 memory error detect 80000008, address 000002d4 data aaaaaaaa -> deadbeef capture_data hi fbefaaaa lo deadbeef ecc 1b1b capture_attributes 01113001 address 000002d4 memXSCF uboot  01070000  (Feb  8 2008 - 11:12:19) XSCF uboot  01070000  (Feb  8 2008 - 11:12:19) SCF board boot factor = 7180     DDR Real size: 256 MB     DDR: 224 MB Than your XSCF card is broked. Replace it with new one. After that it will ask you for enter chassis number - located at front of the server XSCF promt to enter your chasses number ( is a S/N of your server ): Please input the chassis serial number : XXXXXXX 1:PANEL Please select the number : 1 Restoring data from PANEL to XSCF#0. Please wait for several minutes ... setdefaults : XSCF clear : start ......

FOS Password recovery (Brocade Fabric OS Switch Password recovery procedure)

Password recovery using root account If you have access to the root account, you can reset the passwords on the switch to default. This feature is available for all currently supported versions of the Fabric OS. Follow the below steps to reset any account password from the root account. 1. Open a CLI session (serial or telnet for an unsecured system and sectelnet for a secure system) to the switch. 2. Log in as root. 3. At the prompt, enter the passwddefault command as shown below: switch:root> passwddefault 4. Follow the prompts to reset the password for the selected account. For example: switch:root> passwddefault All account passwords have been successfully set to factory default. Once the passwords have been reset, log into the switch as admin, and modify your default passwords. Make sure to keep a hardcopy of your switch passwords in a secure location. The default passwords for Fabric OS switches are: Root fibranne Adminpassword Userpassword Password r

SPARC OBP cheatsheet

Boot PROM Basics Boot PROM(programmable read only memory): It is a firmware (also known as the monitor program) provides: 1. basic hardware testing & initialization before booting. 2. contains a user interface that provide access to many important functions. 3. enables the system to boot from wide range of devices. It controls the system operation before the kernel becomes available. It provides a user interface and firmware utility commands known as FORTH command set. These commands include the boot commands, the diagnostic commands & the commands for modifying the default configuration. Command to determine the version of the Open Boot PROM on the system: # /usr/platform/'uname -m'/sbin/prtdiag -v (output omitted) System PROM revisions: ---------------------- OBP 4.16.4 2004/12/18 05:21 Sun Blade 1500 (Silver) OBDIAG 4.16.4.2004/12/18 05:21 # prtconf -v OBP 4.16.4 2004/12/18 05:21 Open Boot Architectures Standards: It is based on IEEE standard #1275, accord