1846445 Members
2404 Online
110256 Solutions
New Discussion

Re: Clearing Disk Space

 
SOLVED
Go to solution
jeff go
Frequent Advisor

Clearing Disk Space

Hi all,
I have a HP 9000 and am running out of disk space to even apply patches.

I see some files that can possible be deleted/
for example., in /var, there is an rbootd directory, what is this?

if it aint broke, dont fix it
26 REPLIES 26
Rick Garland
Honored Contributor

Re: Clearing Disk Space

Don't know what that dir is.

Is the crash/dump area in the /var filesystems or is it's own filesystem? If it in /var are there files you can compress/remove in there?
How about sar files? (/var/adm/sa) Have you done patch cleanups using the cleanup command?
Have you rotated and/or removed the syslog.log and mail.log files?

Run this command to see what the biggest offenders are:

# cd /var
# du . -x -ka | sort -nr | more

The output will list in ascending order the biggest files to the smallest.

Pete Randall
Outstanding Contributor
Solution

Re: Clearing Disk Space

I would be surprised if there was anything in /var/rbootd. What you really need to look at is the large directories under /var. Use "du -sk /var/* |sort -n" to list the directories in ascending order of size. Concentrate your efforts on those larger directories by again using du and/or ll to examine the contents and see what can be eliminated.

Do NOT remove anything under /var/adm/sw - this is where old versions of patched software are stored so that patches can be removed later - use the cleanup command instead.

Also look at log file. SAM, under "routine tasks" has a pretty good tool for trimming log files. Take a look at that.


Pete

Pete
Gary L. Paveza, Jr.
Trusted Contributor

Re: Clearing Disk Space

You can clear space in the /tmp directory.

Modify /etc/rc.config.d/clean_tmps and set to 1 the CLEAN_TMP variable. Reboot machine and it will delete files in the /tmp directory - and will continue to do so every reboot.

Check /var/adm/crash to see if there are crash files. Unless you are doing a failure analysis, these files can be deleted (and they are usually very large).

Check /var/adm/syslog directory for large files. These can usually be trimmed.

Speaking of trimming, there is a function within sam:

Routine Tasks -> System Log Files which shows you various log files and allows them to be trimmed.
jeff go
Frequent Advisor

Re: Clearing Disk Space

hi all

you guys are excellent...thanks for the tips.

I saw my syslog file and it is huge...
my question is, if I delete this, it will be rcreated automatically, right?
if it aint broke, dont fix it
Rick Garland
Honored Contributor

Re: Clearing Disk Space

NO. Do a `cat /dev/null > syslog.log`

This will 0 the file a continue.
Pete Randall
Outstanding Contributor

Re: Clearing Disk Space

Don't delete it. Use SAM to trim it.


Pete

Pete
Gary L. Paveza, Jr.
Trusted Contributor

Re: Clearing Disk Space

Here's what I do with syslog when it becomes too large:

cd /var/adm/syslog
# Keep a gzip'ed copy of syslog.log
cp syslog.log syslog.log.old
gzip syslog.log.old

# Empty syslog.log
cat /dev/null > syslog.log
jeff go
Frequent Advisor

Re: Clearing Disk Space

thanks..
i used SAM to trim more log files..

looking at my / directory, it is still at 95% and this could be because of the /etc directory...
here is a draft:
/home (/dev/vg00/lvol5 ) : 19608 total allocated Kb
13565 free allocated Kb
6043 used allocated Kb
30 % allocation used
/opt (/dev/vg00/lvol6 ) : 542270 total allocated Kb
226940 free allocated Kb
315330 used allocated Kb
58 % allocation used
/tmp (/dev/vg00/lvol4 ) : 63886 total allocated Kb
25426 free allocated Kb
38460 used allocated Kb
60 % allocation used
/usr (/dev/vg00/lvol7 ) : 1239355 total allocated Kb
394943 free allocated Kb
844412 used allocated Kb
68 % allocation used
/var (/dev/vg00/lvol8 ) : 1145738 total allocated Kb
516222 free allocated Kb
629516 used allocated Kb
54 % allocation used
/stand (/dev/vg00/lvol1 ) : 75359 total allocated Kb
38183 free allocated Kb
37176 used allocated Kb
49 % allocation used
/ (/dev/vg00/lvol3 ) : 142934 total allocated Kb
7136 free allocated Kb
135798 used allocated Kb
95 % allocation used


thanks
if it aint broke, dont fix it
Rick Garland
Honored Contributor

Re: Clearing Disk Space

From the root directory (/) run the following:

# du . -x -ka | sort -nr | more

This command will list the files in ascending order. From this list you can get a better idea of what is the biggest offender.

Also, did you check for core files?
These can be hugh and if you don't save them you can remove them (make sure you don't save them)
Pete Randall
Outstanding Contributor

Re: Clearing Disk Space

Can you post the output from "bdf -l"? Thanks.


Pete

Pete
Gary L. Paveza, Jr.
Trusted Contributor

Re: Clearing Disk Space

Issue the following command:

du -k /etc | sort -rn

Largest directories will appear on the top of the list. (sort -n if you want largest on the bottom).

Once you get this list, then go into the directory and see what files are present.
Hein van den Heuvel
Honored Contributor

Re: Clearing Disk Space


'nother command to find potentially offensive files:

find / -xdev -size +5000
or
find / -xdev -size +5000 -exec ls -l {} \;

The -xdev makes sure find sticks to /
The -size asks for anything over 5000 blocks of 512 or 2.5MB


You might just find a bunch of large
/etc/lvmconf/xxxxxxx.conf.old files.

Hein.



Pete Randall
Outstanding Contributor

Re: Clearing Disk Space

Jeff (I assume),

We've got some issues here to clear up.

1) You originally stated that you were running out of disk space and specifically mentioned /var

2) You have now mentioned that your / directory is 95% full

3) You tried to associate your 95% / directory with your /etc directory

What we need is a "bdf -l" output so we can see what your filesystems look like. Hopefully we've already addressed some of the issues in /var. The rest of your filesystems should be separate from /, so /etc being full should not be too much of an issue - we'll need to look at / by itself.

When / fills, because most everything else is a separate file system, the most likely causes are:

1) a mis-directed backup to, for example, /dev/rmt/Om (that's a capital letter oh). Check /dev for regular files with find:
find /dev -type f -exec rm {} \;

2) core files - again you can use find:
find / -name core -exec rm {} \;

3) something that got written to an unmounted filesystem - for example if /var was unmounted and a large file was placed in /var, it would be written into the mountpoint under /, rather than into the /var filesystem itself. The only way to check for this is to unmount each filesystem and look under the mount point for files. The easiest way to do this is to reboot in single user mode and do an "ll" on each mount point before they are mounted.

I hope this helps clarify.


Pete

Pete
jeff go
Frequent Advisor

Re: Clearing Disk Space

Hi Pete

here is the outpit of bdf command:

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 143360 135548 7369 95% /
/dev/vg00/lvol1 83733 37176 38183 49% /stand
/dev/vg00/lvol8 1179648 629610 516134 55% /var
/dev/vg00/lvol7 1265664 844054 395279 68% /usr
/dev/vg00/lvol4 65536 38460 25426 60% /tmp
/dev/vg00/lvol6 557056 315330 226940 58% /opt
/dev/vg00/lvol5 20480 6043 13565 31% /home


thank you again for your help and i am sorry if i am coming across as a neophyte..:)
if it aint broke, dont fix it
john kingsley
Honored Contributor

Re: Clearing Disk Space

If you've done a lot of patching on this server, /var/adm/sw may be getting big from all of the surperceded patches. In some cases, you may have several levels of superceded patches. You may want to consider committing some of your patches using the cleanup command.

By running:
cleanup -p -c

You can see how much space can be recovered by committing patches which have been superceded by at least of times.

Be careful when using this command though. Once you've removed a superseded patch, you will no longer be able to rollback to it.
Jannik
Honored Contributor

Re: Clearing Disk Space

ok so the problem is in '/' could you send the output from the command 'du -sk /*'.
jaton
jeff go
Frequent Advisor

Re: Clearing Disk Space

# du -sk /*
0 /bin
0 /cdrom
2 /cpu
13 /dev
113857 /etc
4870 /home
0 /lib
0 /lost+found
0 /nsmail
102 /nsr
312093 /opt
18967 /sbin
37176 /stand
36959 /tmp
0 /tmp_mnt
836960 /usr
620563 /var
if it aint broke, dont fix it
Jannik
Honored Contributor

Re: Clearing Disk Space

U have a small dir /cpu and then U have /etc; etc is really thaking a lot of space, but that could be ok.
That about none directories in the / directory (like .sh_history and .bash_history) ?
does the command 'find / -name core' come up with anything?
jaton
Rick Garland
Honored Contributor

Re: Clearing Disk Space

Seeing the output you have provided - the / filesystem is relatively small.

You may want to look at using Ignite to resize the / filesystem and others - give you some more breathing room.
Patrick Wallek
Honored Contributor

Re: Clearing Disk Space

Your /etc/ directory is much much too big.

I have check 3 of my systems and the largest is aobut 17 MB. Yours is over 100.

Do the same command in /etc.

# du -ks /etc/* | sort -n

And see what is the largest file or directory.
jeff go
Frequent Advisor

Re: Clearing Disk Space

Hi Patrick

the biggest directory is named dir.

unfortunately this server is my DNS server so i cannot erase that file...

any suggestions ?
if it aint broke, dont fix it
Patrick Wallek
Honored Contributor

Re: Clearing Disk Space

A directory named 'dir' does not sound like anything that should be used by DNS.

Are you positive that is part of your DNS config? If so, I would name it something else, if possible.
Geoff Wild
Honored Contributor

Re: Clearing Disk Space

Have you done a patch cleanup?

cleanup -c 2

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Carlo Corthouts
Frequent Advisor

Re: Clearing Disk Space

Hi hpjeff,

First of all if you see you are not receiving anymore syslog messages, restart the syslog daemon after deleting or trimming the syslog.log file.

What you also can look into is the /etc/lvmconf directory and check all the .old files. You could zip these to gain some more space or just delete them.
Don't delete the original config files of your volumegroups.

Did you check your system for coredumps?

Best is to move your dns configuration files under /var as it is easier to expand if needed.

A cleanup of the old patches is also a good idea if you plan on installing a new patchbundle.
cleanup -p -c 2 gives you an idea of the space you could gain.
But make sure before you start deleting these files to make a recovery tape of your system with ignite just to be on the safe side.

Regards,

Carlo