Operating System - HP-UX
1833778 Members
2416 Online
110063 Solutions
New Discussion

Deleting /var/adm/sw/save

 
SOLVED
Go to solution
Alex_17
Frequent Advisor

Deleting /var/adm/sw/save

Hi,

is it safe deleting /var/adm/sw/save??. One of our sysadmin do it every time he needs space in /var, but I'm not sure if this can be done so easily.

Thanks in advance,

Alex.
11 REPLIES 11
Alex Glennie
Honored Contributor
Solution

Re: Deleting /var/adm/sw/save

If you play with fire you will get burnt one day ;)

By default at 11.0 during patch installation, SD-UX makes rollback copies of all
files and archive library objects modified. These copies are saved under
the "/var/adm/sw/save" directory structure and do occupy disk space.

When desired, this disk space can be regained. Of course, when doing so
there will be no way to "uninstall" the patch with swremove(1M).
The rollback copies are removed from the system when the patch is "committed".

The process of "committing" a patch is accomplished with the swmodify(1M)
command. It is necessary to specify which patch filesets are to be
committed; thus, to commit an entire patch you would use a command similar
to:

swmodify -x patch_commit=true PHCO_13284.\*

Once a patch is committed, the "patch_state" is changed from "applied" to
"committed". This can be observed by the following command:


swlist -l patch -a patch_state [PHCO_13284/PACHRDME/English]

The "cleanup" command may be used to simplify this process when only the
rollback information for superseded patches is to be removed.


Running the following command will remove space for superseded patches in
/var/adm/sw/save:

cleanup -c [number_of_time_superseded]

The new "-c" option is added in PHCO_19550. The cleanup(1) man page explains
the new option:

-c
Commit patches superseded at least times.
This option is a front-end to the 'patch_commit'
option of swmodify(1M) that provides an easier
interface to commit multiple patches at once.

Running cleanup -c 1 will display all patches that have been superseded
at least one time and then prompt for removal of their rollback information.
As with all cleanup options no patch information will be removed without
prompting the user first.

NOTE: For more information see the white paper located at
/usr/share/doc/patch_pgrm.txt and the man page for cleanup.
Frederic Sevestre
Honored Contributor

Re: Deleting /var/adm/sw/save

Hi,
To commit a list of patch you can use a file :
swmodify -x patch_commit=true -f
where file contains the list of the patches you want to commit :
PHxx_xxxxx.*
Regards
Fr??d??ric
Crime doesn't pay...does that mean that my job is a crime ?
Philip Chan_1
Respected Contributor

Re: Deleting /var/adm/sw/save


No!!! don't just delete files from that directory because all previously overwritten patches were stored there for rollback purpose.

The proper way of cleaning up files in such dir is to "commit" your recently installed patches. After that the saved patches in /var/adm/sw/save will be removed. The commands for commiting patches are,

swlist -l fileset -a name | grep PH > /tmp/patchlist
swmodify -x patch_commit=true -f /tmp/patchlist

Rgds,
Philip

Marcin Wicinski
Trusted Contributor

Re: Deleting /var/adm/sw/save

Hi,
deleting /var/adm/sw/save is very dangerous operation and I do not recommend to do that. Better way is to use cleanup -c command (mentioned above).
Later,
Marcin Wicinski
Praveen Bezawada
Respected Contributor

Re: Deleting /var/adm/sw/save

Hi
Deleting from /var/adm/sw/save is not the correct thing to do.
HP general release patches and other patches occupy lot of space here, This is because old patches are stored as backup.So you can commit the patches to remove the old patches to gain space. See man for swmodify
Hope this helps
...BPK...
Alex_17
Frequent Advisor

Re: Deleting /var/adm/sw/save

Does it mean we should "commit" patches one by one??.

Alex.
Frederic Sevestre
Honored Contributor

Re: Deleting /var/adm/sw/save

You will have to commit the patchs one by one. But in fact you can use a file which contain the list :

swlist -l patch -a patch_state | grep | grep "^# PH" > /tmp/list_patch

where state is the state of the patches you want to commit (applied, superseded..)

The edit the list and modify it to have the following format :

PHxx_xxxxx.*

then use swmodify :

swmodify -x patch_commit=true -f

like this you won't have to commit the patches one by one.
Crime doesn't pay...does that mean that my job is a crime ?
Alex_17
Frequent Advisor

Re: Deleting /var/adm/sw/save

Hi,

I've made a cleanup -c 1, but what if I want to recover more space than that?

Alex.
Marcin Wicinski
Trusted Contributor

Re: Deleting /var/adm/sw/save

Hi,
get into /var directory and perform:
# du -s ./*

Check which subdirs are large.
Marcin Wicinski
Frederic Sevestre
Honored Contributor

Re: Deleting /var/adm/sw/save

Try the swmodify for al the applied patches. It sould free more space.
Crime doesn't pay...does that mean that my job is a crime ?
Darrell Allen
Honored Contributor

Re: Deleting /var/adm/sw/save

Hi Alex,

You've already been given very good advice. One other point to make: Don't just automatically commit patches. If you do so, you will not be able to uninstall the patch with swremove. Patches are often recalled. Even though eventually another patch will supersede the recalled patch, you would have to wait for that patch to be released.

I always run my system awhile without committing newly installed patches until I'm confident I will not need to remove them. How long is that? For me, it's usually just before the next time I install a bundle. Currently that's 3 months.

If you've never committed patches on your system then obviously you need to do so.

Please educate the sysadmin that is removing /var/adm/sw/save. A big stick may help him remember the lesson and make you feel better too!

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)