Discussion:
/Var has no space
(too old to reply)
TechinLA
2006-09-20 05:30:14 UTC
Permalink
I decided to install a bunch of updates from the Sun Update service last
night. And some or most didn't complete successfully because /var is full
and has no space. I checked and the pkg directory for installing the Solaris
updates is what is taking the space. Can I delete them? What can I do to
regain the space? I haven't experienced this before and wanted to know if
anyone else could give some advice on this.

DJ
Michael Vilain
2006-09-20 07:03:01 UTC
Permalink
Post by TechinLA
I decided to install a bunch of updates from the Sun Update service last
night. And some or most didn't complete successfully because /var is full
and has no space. I checked and the pkg directory for installing the Solaris
updates is what is taking the space. Can I delete them? What can I do to
regain the space? I haven't experienced this before and wanted to know if
anyone else could give some advice on this.
DJ
If you've checked the usual places for log files, etc. and there's still
no space, I don't think there's much you can do. If you're lucky,
there's a large /opt or maybe /export right next to it on the partition
map. If that's the case, you can backup /var and the adjacent slice,
dismount it, fiddle with it's partition map allocation (decreasing the
cylinders in the adjacent map and giving them to /var). newfs the
adjacent slice, restore it, then either use growfs (if it's installed)
or temporarily remap /var to yet another slice, newfs the old /var slice
and restore it from the backup, and reboot with the /var pointing back
to the new, expanded /var. Sounds like fun, huh?

Or you could just back everything up on the system disk, boot from the
Install CD, re-layout the disk, and restore from the tape backup.

I don't know if SVM can be used to make any partition on the root volume
into anything other than a mirror. Same for VxVM. But maybe this is
just my "old school" training and stuff has changed with newer releases
of Solaris.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
Daniel Rock
2006-09-20 07:58:37 UTC
Permalink
Post by TechinLA
I decided to install a bunch of updates from the Sun Update service last
night. And some or most didn't complete successfully because /var is full
and has no space. I checked and the pkg directory for installing the Solaris
updates is what is taking the space.
If you don't want to backout the patches again you can just get rid of the
undo backup files:

find /var/sadm/pkg -name '1?????-??' -type d -exec rm -rf {} +

Maybe this is not the "cleanest" solution but this should give you some
more space - depending how often you patched in the past up to 1 GB.
--
Daniel
Tim Bradshaw
2006-09-20 12:13:37 UTC
Permalink
Post by Daniel Rock
If you don't want to backout the patches again you can just get rid of the
find /var/sadm/pkg -name '1?????-??' -type d -exec rm -rf {} +
Maybe this is not the "cleanest" solution but this should give you some
more space - depending how often you patched in the past up to 1 GB.
Another alternative is to replace /var/sadm with a symlink to somewhere
on a filesystem which has space (copying the contents first). Also not
really satisfactory, but it might get you through the night.

--tim
Scott Wilson
2006-09-20 16:25:41 UTC
Permalink
Post by Tim Bradshaw
Post by Daniel Rock
If you don't want to backout the patches again you can just get rid of the
find /var/sadm/pkg -name '1?????-??' -type d -exec rm -rf {} +
Maybe this is not the "cleanest" solution but this should give you some
more space - depending how often you patched in the past up to 1 GB.
Another alternative is to replace /var/sadm with a symlink to somewhere
on a filesystem which has space (copying the contents first). Also not
really satisfactory, but it might get you through the night.
Be very careful while patching if you do this. I had a box that
I did this to due to disk space (it had a pathetically small /var....
I inherited the thing), and there was once a patch in a patch
cluster that broke the symlink. It created a new /var/sadm
that was almost empty, and the patching process then failed for
all remaining patches in the cluster.

I was able to clean it up, and I haven't seen it happen again....
but it may.
--
Scott Wilson Lead System Administrator
***@uchicago.edu NSIT - DCS - SeaSol
Daniel Rock
2006-09-20 18:24:50 UTC
Permalink
Post by Scott Wilson
Be very careful while patching if you do this. I had a box that
I did this to due to disk space (it had a pathetically small /var....
I inherited the thing), and there was once a patch in a patch
cluster that broke the symlink. It created a new /var/sadm
that was almost empty, and the patching process then failed for
all remaining patches in the cluster.
This could be because of:
/var/sadm d none 0755 root sys SUNWadmr ...
in /var/sadm/install/contents. The package database assumes this pathname
is a directory, no symbolic link. If you install some patch the directory
might be recreated.

Therefor I prefer (if I cannot avoid them) loopback mounts on system
directories. Say you want to migrate /var/sadm to /space/sadm:

put an entry of the form

/space/sadm - /var/sadm lofs - yes -

in your /etc/vfstab somewhere after the line which mounts /space.
--
Daniel
Stefaan A Eeckels
2006-09-20 10:07:43 UTC
Permalink
On Tue, 19 Sep 2006 22:30:14 -0700
Post by TechinLA
I decided to install a bunch of updates from the Sun Update service
last night. And some or most didn't complete successfully
because /var is full and has no space. I checked and the pkg
directory for installing the Solaris updates is what is taking the
space. Can I delete them? What can I do to regain the space? I
haven't experienced this before and wanted to know if anyone else
could give some advice on this.
You could check for the existence of "obsolete.Z" files in
the /var/sadm/pkg hierarchy. If you've done a lot of patching these
files can take up a lot of space. They can be removed without ill
effect. For example:

# find /var/sadm/pkg -type f -name obsolete.Z -exec rm {} +

This can recover several hundreds of megabytes depending on the number
of patches applied.
--
Stefaan A Eeckels
--
...one of the chief advantages of a CLI over a GUI: people who are
truly clueless are more likely to give up and walk away before they
mess things up too badly. --Logan Shaw
Gary Mills
2006-09-20 14:23:05 UTC
Permalink
Post by TechinLA
I decided to install a bunch of updates from the Sun Update service last
night. And some or most didn't complete successfully because /var is full
and has no space. I checked and the pkg directory for installing the Solaris
updates is what is taking the space. Can I delete them? What can I do to
regain the space? I haven't experienced this before and wanted to know if
anyone else could give some advice on this.
One thing you can do in this case is to clean out /var/sadm/spool, and
then set up a patch download directory on another partition that does
have the space. This only helps if /var/sadm has sufficient space for
the patch and package files.

You can use `smpatch set' to specify a different download directory,
which you have to first create. Then `smpatch get' should show it,
like this:

$ smpatch get
patchpro.backout.directory - ""
patchpro.download.directory /opt/sadm/spool /var/sadm/spool

Changing this setting adds a line to /etc/patch/patch.conf, like this:

patchpro.download.directory=/opt/sadm/spool

The real solution is to ensure that /var is large enough. 5 GB should
be sufficient.
--
-Gary Mills- -Unix Support- -U of M Academic Computing and Networking-
TechinLA
2006-09-25 14:18:55 UTC
Permalink
Well, after trying several of the posts in this thread and having no luck
still, I found that it was my /var/crash directory that was taking about 400
megabytes of space. I deleted a file in there called "unknown" which
contained dumps from when the system paniced I guess. Anyway, all is well
now. Thanks to everyone who posted to this thread and for your help.

DJ
Post by TechinLA
I decided to install a bunch of updates from the Sun Update service last
night. And some or most didn't complete successfully because /var is full
and has no space. I checked and the pkg directory for installing the
Solaris updates is what is taking the space. Can I delete them? What can I
do to regain the space? I haven't experienced this before and wanted to
know if anyone else could give some advice on this.
DJ
Loading...