Operating System - HP-UX
1830482 Members
2708 Online
110005 Solutions
New Discussion

Cleaning up /usr filesystem

 
Chet Woods
Frequent Advisor

Cleaning up /usr filesystem

Hi all,

I've just inherited a server that the /usr filesystem is at 95%. Anyone have any ideas on logfiles, or any other "useless" stuff (at this point anyway) that I can dump??

Thanks,
Chet
12 REPLIES 12
Rick Garland
Honored Contributor

Re: Cleaning up /usr filesystem

Depends on the the previous admin had configured.

Do the following commands;
# cd /usr
# du . -ka | sort -nr | more

The du command (with the sort) will provide you a list of files from biggest to smallest. Once you have this list you can parse through.

The /usr/bin, /usr/sbin/, /usr/lib, etc you will want to leave alone. What else have you got?


A. Clay Stephenson
Acclaimed Contributor

Re: Cleaning up /usr filesystem

These days there is very little in /usr that can be considered useless. In the old days, there was /usr/tmp, /usr/spool/lp, /usr/adm, ... but nowadays those are all symbolic links to /var --- where the actual files are. You may have some junk in /usr but it will be specific to your machine so there's no "standard" answer for you.
If it ain't broke, I can fix that.
Chet Woods
Frequent Advisor

Re: Cleaning up /usr filesystem

Here's what I get with a "du" command:
(of course this is only the first "page" of content from the du, but nothing is really standing out at me)
629044 .
219706 ./lib
75120 ./dt
66016 ./share
50038 ./conf
48778 ./share/man
47326 ./lib/X11
38886 ./sbin
38194 ./bin
31462 ./sam
25986 ./lib/X11/fonts
24726 ./conf/lib
23864 ./dt/appconfig
23372 ./lib/sw
22290 ./contrib
21064 ./lib/sw/hpux.install
18910 ./lib/X11/Xserver
18526 ./lib/nls
18018 ./java
17640 ./dt/bin
16412 ./dt/lib
15616 ./sam/lib

Thanks,
Chet

Paul_481
Respected Contributor

Re: Cleaning up /usr filesystem

Hi Chet,

Did you check your vg00? It has probably some space left. If it has, extend the /usr. Its very hard to determine what is not important in your /usr.

#vgdisplay -v vg00

Regards,
Paul
Nguyen Anh Tien
Honored Contributor

Re: Cleaning up /usr filesystem

Hi Chet.
1, Have you found core file on this file system
let try this command:
#find /usr -name core -exec rm -f {} \;
to delete all core file.
2, determine which directory if biggest by issue this command
#du -sk|sort -nr
Regard
tienna
HP is simple
Ranjith_5
Honored Contributor

Re: Cleaning up /usr filesystem

Hi Chet,

Run the following script and select /usr when prompted for a diretory to search. input 10000 when prompted for size of files.and 300 for the next prompt. You can find the output in find.out file as well as on screen.

#This script finds recenty created large files
#
#Syam K
#Consultancy
#26/01/2004
#
#
rm -f find.out

echo
echo "Enter directory to search"
read DIRNAME

if [ ! -d $DIRNAME ]
then
echo "Error: directory $DIRNAME does not exist"
exit 1
fi

echo
echo "How large a file do you want to look for ? (in Kbytes)"
read SIZE

echo
echo "How many days since the file was created ?"
read DAYS

echo
echo "Searching..."

find $DIRNAME -type f -size +$SIZE -mtime -$DAYS -exec ls -ls {} \; | sort -n -r | tee find.out

echo
echo "Done"
echo
echo "Note: output in find.out"
echo

Hope this helps.

Regards,
Syam
Ranjith_5
Honored Contributor

Re: Cleaning up /usr filesystem

Hi Chet,

One more thing..

If you have a vertitas backup oftware installed on this machine, the log files of the same will be there at

/usr/openv/netbackup/logs/bpcd/

/usr/openv/netbackup/logs/bpbkar/

/usr/openv/netbackup/logs/bptm/


Regards,
Syam
Bill Hassell
Honored Contributor

Re: Cleaning up /usr filesystem

/usr is not like /var where temp files and logs are created. It is mostly programs and libraries. 629k (du reports in 512byte units) is only 315megs, a VERY, VERY small! /usr should be at least 750megs but more normal is 1000-1500megs in size. So you inherited a server that was badly sized. You can go into single user mode and increase /usr assuming that VG00 has unused space. Otherwise, use bdf to show how VG00 is laid out and if everything is almost full, it's time to add another disk. The only thing you might remove are the man pages in /usr/share but then all your online documentation will be gone.


Bill Hassell, sysadmin
Mic V.
Esteemed Contributor

Re: Cleaning up /usr filesystem

I've been able to get a little space back by deleting some whitepapers -- /usr/doc??

The best thing to do is extend /usr into unused vg00 extents. Second best, when you can't reboot the server and/or don't have OnlineJFS -- just my opinion -- *CAREFULLY* create a new filesystem in vg00 to hold some old stuff from /usr -- say, /usr/lib/X11. Move it from the original /usr to the new filesystem and install a link. Third choice, and you have to be even more CAREFUL, understanding what's needed during the boot process, etc -- create a new filesystem outside vg00 and move the stuff there -- say, /usr/lib/X11.

Your mileage may vary. These are kind of desperate tactics.

Mic
What kind of a name is 'Wolverine'?
Chet Woods
Frequent Advisor

Re: Cleaning up /usr filesystem

Thanks to everyone...I've read it all and I've succumbed to the fact that I just need to "bite the bullet" and give it some more space. At this point it seems like the best thing to do. This is an old E-series server that we won't be (nor do I think we even can any longer) buying additional space for it. It only houses one application that's going away soon....so it's really a temporary fix that I need to implement.
Thanks again...
Chet
Mic V.
Esteemed Contributor

Re: Cleaning up /usr filesystem

Chet -- my peers may or may not agree, but if it's not growing, you may be able to get by with doing nothing. You have to watch and see, if you have the luxury of waiting to see -- you didn't mention how critical the app was. It kind of depends on the impact of running out of space...

Mic
What kind of a name is 'Wolverine'?
Michelle Barton
Frequent Advisor

Re: Cleaning up /usr filesystem

Hey! Are you already blaming me for things ;)

Michelle