clearing space on /USR/

clearing space on /USR/

Post by ITguy_ » Sat, 07 Feb 2004 21:18:06



I have a Solaris 2.8 server here that is running low on space on its
/USR/ directory.  I have spoken with the person that originally
installed the OS and it appears that to make sure they had everything
installed they installed everything with all options when installing
the OS.

I have used "df- k" to look at the disk configuration:

# df -k
Filesystem            kbytes    used   avail capacity  Mounted on
/dev/dsk/c0t0d0s0     962571  164270  740547    19%    /
/dev/dsk/c0t0d0s6    1987399 1883060   44718    98%    /usr
/proc                      0       0       0     0%    /proc
fd                         0       0       0     0%    /dev/fd
mnttab                     0       0       0     0%    /etc/mnttab
/dev/dsk/c0t0d0s1     962571  105284  799533    12%    /var
swap                  315232      24  315208     1%    /var/run
swap                  358688   43480  315208    13%    /tmp
/dev/dsk/c0t0d0s4    11395244 4501202 6780090    40%    /userfiles1
/dev/dsk/c0t0d0s5     962571   16343  888474     2%    /opt
/dev/dsk/c0t0d0s7     638479     291  580725     1%    /export/home

and format and describe command gives:
     Current Disk = c0t0d0
     <SUN18G cyl 7506 alt 2 hd 19 sec 248>

From looking at the Solaris 2.8 documentation a Solaris 2.8 install
requires as a minimum 1.7Gb of disks space and the /usr directory on
this sever only has 1.9Gb which makes the /USR mount short on space.

I have a couple of questions which are basically freeing space on /USR
or adding  storage:

  1. Is there anyway of removing packages that are not needed from
Solaris?

  2. Are there any large files that maybe in /USR that can be removed?

  3. How difficult would it be to add a disk and at this space to
/USR?
  I will read the documentation etc on this but would like to know if
others
  think this is a viable option.

Any hints or info would be appreciated.

 
 
 

clearing space on /USR/

Post by aryzh » Mon, 09 Feb 2004 07:10:39



>   1. Is there anyway of removing packages that are not needed from
> Solaris?

Sure. "pkgrm" is the command.
My approach would be:
pkginfo >/tmp/a
cp /tmp/a /tmp/b
vi /tmp/b (remove lines that you think are not needed)
pkgrm `diff /tmp/a /tmp/b | awk '$1=="<" {print $3}'`

This, however, is rather dangerous if you are not absolutely sure
what pachage does what. Backup would be a good idea, anyway.
However, if you by accident remove a necessary package,
it is usually possible to install it back from Solaris
CD or Jumpstart server using "pkadd" command

Quote:>   2. Are there any large files that maybe in /USR that can be removed?

A very dirty way that I sometimes use on non-critical temporary machines,
is to remove all sttaic libraries (it's quite rare to build stsic apps
these days).
 find / -name lib\*.a -exec rm {} \;
Note that pkg tracking utilities will be partially confused after that.
Also, you may gain some space by removing "demo" and "src" directories
wherever you find them (/usr/openwin/demo, /usr/dt/demo, ...)

Quote:

>   3. How difficult would it be to add a disk and at this space to
> /USR?

Not difficult at all; you need to know the commands
  devfsadm
  forrmat
  newfs
  mount
  umount
  ufsdump/ufsrectore or cpio. Tar will probably do as well.
  mv
You also need to know how /etc/vfstab is built and used

The main trick is - you can not easily remove,rename, remount
or unlink /usr while booted from the same disk. The easiest is
to boot from CD or net to do this job. Some very careful actions
in single-user mode can be taken instead, but you may need
statically linked "mv" command which is not available in standard Solaris,
though is easy to write in C and compile.

Regards,
Andrei

 
 
 

1. /usr/bin/{reset,clear) - clear does not work even after reset

After spilling a binary file on an xterm screen, I run /usr/bin/reset to
clear things up (get normal character set back instead of the
hierglyphs).

But then /usr/bin/clear still is not working, and command
line editing is a bit flaky, too (for example, backspace does not remove
characters on the screen, just passes over them. They do get deleted
from the buffer, though).

I manually ran stty -a on a known good xterm and the bad xterm and
adjusted 2-3 settings that were different, but still no luck.

What else could it be?? Thanks ...

----

Speaking for myself only

2. Adelphia

3. clear command - Clear does not clear my screen.

4. Wierdness with Magneto-Optical disks

5. /usr/bin/clear: /dev/null: cannot create

6. Dialup to Supra Int. -- CAN'T work normally

7. Clearing out /usr/spool/mqueue

8. Netscape v1.12 problem

9. Problems with /usr/bin/clear in RH5.0

10. /usr/bin/clear

11. safe way to clear space?

12. no disk space; clear ~/.kde/share?

13. is it possible to clear out hold space in sed(1V)?