Cleaning Up /var/sadm

unix

    Next

  • 1. Acceptance Test for SUN Cluster
    Salut Newsgroups You have some Papers/technical Docus for SUN Cluster Acceptance Tests? thanks for any idea and support kind regards
  • 2. testing Disk Mirroring with SVM
    I did mirror my bootdisk and made entries for boot-device so that the system can boot from rootmirror if rootdisk is unavailable/dead. I tried removing my rootdisk and reboot the machine only to find out that metadb are stale(system went to Single user mode) and metadb -i showed unknown for block count for the removed HDD. (c1t1d0s6) # metadb -i flags first blk block count a m p luo 16 8192 /dev/dsk/c1t1d0s6 a p luo 8208 8192 /dev/dsk/c1t1d0s6 a p luo 16400 8192 /dev/dsk/c1t1d0s6 a p luo 16 8192 /dev/dsk/c1t0d0s6 a p luo 8208 8192 /dev/dsk/c1t0d0s6 a p luo 16400 8192 /dev/dsk/c1t0d0s6 So It appears that I would need more than half of the copies of db's to be available to have the system booted from rootmirror when rootdisk is unavailable. Also, The master copy of db lies on rootdisk slice. Did I miss something while I set up this mirror? Everything is fine When I boot from rootmirror with rootdisk in place. Can some one tell me how to test whether the system will boot from rootmirror when rootdisk is unavailable? Thanks, Shivakanth

Cleaning Up /var/sadm

Postby jseymour » Fri, 28 Nov 2003 13:50:26 GMT

I like to install patches so I can back them out, but /var/sadm is
now taking up more space in /var than anything else.  So I was
wondering if I could safely remove the backout stuff once I was
convinced the system was stable.

The most definitive answer I could find was this, from Casper Dik,
back in April of 1998:

     http://www.**--****.com/ %40uk-usenet.uk.sun.com
    
Does Casper's advice (at that time) of

    rm -r /var/sadm/pkg/*/save/*
    
still apply as of Solaris 7?

The reason I ask is that he also talks about "backoutpatch"s in that
message, and these don't seem to exist anymore?  So apparently 
something's changed since then?

TIA,
Jim
-- 
Jim Seymour                    | PGP Public Key available at:
                               |  http://www.**--****.com/ 
                               |
                               |  http://www.**--****.com/ 

Re: Cleaning Up /var/sadm

Postby Chapter33 » Sat, 29 Nov 2003 05:17:39 GMT




Hi Jim,

Yes it does apply to Solaris 7 and beyond, but if you only want to
delete backout stuff after you're sure everything is ok, then I
wouldn't do a blanket delete of the lot.  I would delete files in
those directories that were older than a certain number of days, e.g.
60 days as follows:

    find /var/sadm/pkg/*/save -type f -mtime +60 -ls

...to list the files that will be deleted

    find /var/sadm/pkg/*/save -type f -mtime +60 -exec rm -f {} +

...to delete them.

Backout patches do still exist in Solaris 7, see the patchrm(1M) man
page.

Best regards,
Mark.

Re: Cleaning Up /var/sadm

Postby Olive72 » Mon, 02 May 2011 00:31:34 GMT

Excellent Tip 

find /var/sadm/pkg/*/save -type f -mtime +60 -exec rm -f {} +



Similar Threads:

1.Repost: Solaris Live Upgrade: questions about /var/sadm

Sorry for the report, seems like my news reader misbehaved (Ah, MSFT!)

 According to the solaris FAQ:

--------8<-----------------

|3.40) Why does installing patches take so much space in /var/sadm?

    All the files that are replaced by a patch are stored under
    /var/sadm/patch/<patch-id>/save so the patch can be safely
    backed out.  Newer patches will save the old files
    under /var/sadm/pkg/<pkg>/save/<patch-id>/undo.Z, for each package
    patches.

    You can remove the <patchdir>/save directory provided you also
    remove the <patchdir>/.oldfilessaved file.  Newer patches will not
    install a .oldfilessaved file.

    Alternatively, you can install a patch w/o saving the old
    files by using the "-d" flag to installpatch.

|3.41) Do I need to back out previous versions of a patch?

    No, unless otherwise stated in the patch README.
    If the previous patch installation saved the old
    files, you may want to reclaim that space.

    Patches can be backed out with (Solaris 2.6+):
     patchrm <patch-id>

    or in earlier releases:

     /var/sadm/patch/<patch-id>/backoutpatch <patch-id>

    Backoutpatch can take an awful long time, especially when the
    patch contained a lot of files.  This is fixed in later versions
    of backoutpatch.

---------------->8---------------------------

Prior to doing the live upgrade, I would like to minimize the size of my
root partition
(containing /var in my case) Can I safely remove all patches (not just the
save directories)
from /var/sadm/patches or will live upgrade do it automatically ?

I presume that after a solaris upgrade, the liste of installed patches on
the system will be NULL ?

Another last point, does "back out patch" mean to go back to the state
BEFORE the patch was applied ?
I don't understand the 3.41 paragraph. What does it mean ? It seems to mean
that whenever you apply a new
patch, you should go back to the previous version before installing ?

Ex: Original package = blabla-01

Apply patch blabla-02  (BlaBla-01 saved)

You now want to apply patch blabla-03.

Does question 3.41 ask: "if you need to install patch blabla-03 you should
first back ou to blabla-01 ?"

If so, what do you do if the README tells you that you have to, but you
REMOVED the save directory ?

Thanks !


2.Solaris Live upgrade: questions about /var/sadm/patch

 According to the solaris FAQ:--------8<-----------------|3.40) Why does
installing patches take so much space in /var/sadm?    All the files that
are replaced by a patch are stored under    /var/sadm/patch/<patch-id>/save
so the patch can be safely    backed out.  Newer patches will save the old
files    under /var/sadm/pkg/<pkg>/save/<patch-id>/undo.Z, for each package
patches.    You can remove the <patchdir>/save directory provided you also
remove the <patchdir>/.oldfilessaved file.  Newer patches will not
install a .oldfilessaved file.    Alternatively, you can install a patch w/o
saving the old    files by using the "-d" flag to installpatch.|3.41) Do I
need to back out previous versions of a patch?    No, unless otherwise
stated in the patch README.    If the previous patch installation saved the
old    files, you may want to reclaim that space.    Patches can be backed
out with (Solaris 2.6+):     patchrm <patch-id>    or in earlier releases:
/var/sadm/patch/<patch-id>/backoutpatch <patch-id>    Backoutpatch can take
an awful long time, especially when the    patch contained a lot of files.
This is fixed in later versions    of
backoutpatch.---------------->8---------------------------Prior to doing the
live upgrade, I would like to minimize the size of my root partition
(containing /var in my case) Can I safely remove all patches (not just the
save directories)from /var/sadm/patches or will live upgrade do it
automatically ? I presume that after a solaris upgrade, the liste of
installed patches on the system will be NULL ?Another last point, does "back
out patch" mean to go back to the state BEFORE the patch was applied ? I
don't understand the 3.41 paragraph. What does it mean ? It seems to mean
that whenever you apply a newpatch, you should go back to the previous
version before installing ?Ex: Original package = blabla-01Apply patch
blabla-02  (BlaBla-01 saved)You now want to apply patch blabla-03.Does
question 3.41 ask: "if you need to install patch blabla-03 you should first
back ou to blabla-01 ?" If so, what do you do if the README tells you that
you have to, but you REMOVED the save directory ?Thanks !


3./var/sadm/pkg is very huge

Hello.

I noticed that my /var/sadm/pkg is rather big. It's currently about 1.7g.
Can I deleted no longer required "save" directories from there (like
/var/sadm/pkg/SUNWzfsu/save)?

Thanks,

Alexander Skwar

4./var/sadm/pkg direcotry Q

Since the pkginfo files in the /var/sadm/pkg/pkg_name is not being touched
if i remove /var/sadm/pkg/pkg_name/save dir, removing the save direcotory is
not going to effect when i run pkgrm or patchrm?  or is the pkginfo files
being called only when i run the command pkginfo, showrev -p and
patchadd -p?

what is the save dir for anyway?




-- 
****PLEASE REMOVE "_SPAM_SUCKS" before reply


5.frequency alphabet for files in /var/sadm/install/contents

not sure if anyone will have any use for this, but here goes.
(i got this as a side effect.)

i wanted to know what characters appeared in file names NORMALLY,
not everything that was possible.

nawk '{print $1}' /var/sadm/install/contents > scratch

take scratch, ignore / and newline, and count the characters.
ignore = since that serves to indicate links.  ignore # since
that occurs only as an artifact of the contents file.
remember that things like "usr" will get counted a lot.
here's what i got.  i did notice the tilde, which looks like a
packaging mistake.  i tracked it down:

/usr/share/lib/mailx/mailx.help
/usr/share/lib/mailx/mailx.help.~

SUNWcsu package.  but the two files are indeed quite
different, so i think it's not a mistake.

287074	s
224890	a
203628	e
190887	r
179342	o
179100	p
162660	i
155725	t
141892	n
140474	l
140236	.
131468	m
120406	c
81012	u
78606	S
74962	b
70963	d
66863	U
63377	W
59706	v
52406	g
50227	N
49836	h
49076	2
40985	f
39950	6
37067	3
31540	_
29449	k
26785	-
26317	1
23642	w
22806	x
22763	0
22096	C
15593	4
12734	j
12081	9
11736	T
11595	X
11346	7
10921	y
10081	E
10076	5
9697	8
8247	R
6931	D
6709	+
6621	V
5759	A
5395	I
5330	M
5150	F
5055	B
4412	P
3863	L
3134	O
2587	z
2575	%
2366	J
2295	G
1915	H
1598	q
1591	Z
1123	$
1108	K
673	,
262	Y
220	Q
125	:
82	@
1	~

@ usually, but not always, occurs in /dev or /devices.  (only 3,
all in /usr)
"," usually occurs in combination with "SUNW", in /usr/platform
and java primarily.


one frequency alphabet for ordinary english i found:

etoanrishcdlfmugypwbvkxjqz

though, of course, i don't have character counts.

j.
-- 
Jay Scott		512-835-3553		 XXXX@XXXXX.COM 
Head of Sun Support, Sr. Operating Systems Specialist
Applied Research Labs, Computer Science Div.                   S224
University of Texas at Austin

6. /var/sadm/pkg

7. for huge "recommended" patch, not enough room in /var/sadm/patch

8. /var/sadm/spool



Return to unix

 

Who is online

Users browsing this forum: No registered users and 20 guest