Operating System - HP-UX
1823179 Members
3571 Online
109647 Solutions
New Discussion юеВ

Re: /usr file system full

 
Kenn Chen
Advisor

/usr file system full

my /usr file system almost full (97%) and I cannot find any big file in this directory. ?usr and /var file system are linked with each other ?? SOmeone can explain to me the /usr & /var directory. How could I find some files in /usr that i can remove it. Thanks.
Cyber Zen
11 REPLIES 11
Animesh Chakraborty
Honored Contributor

Re: /usr file system full

hi,
Do you have link of following files in /usr ?

adm -> /var/adm
mail -> /var/mail
preserve ->/var/preserve
spool -> /var/spool
tmp -> /var/tmp
normally /usr does not grow as compared to the /var
You must do house keeping regularly in /var.

best of luck
Animesh

Did you take a backup?
Sridhar Bhaskarla
Honored Contributor

Re: /usr file system full

Idris,

Not all the directories are linked from /usr to /var. You really need to check if you have any software installed under usr. There is a directory called /usr/local and some softwares tend to go in there. If it is too big, you may want to create a seperate file system for it.

You can verify which directory is taking most of the space by doing

#cd /usr
#du -sk |sort -n

This will give a good idea. /usr has lib that occupies around 200 MB with sbin being around 100. Other miscellenous shouldn't take more than another 150MB.
/usr/adm and /usr/tmp are linked to /var/adm and /var/tmp.

There are some sofwares that like to go into /usr. I would create a seperate file systems for such softwares.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sanjay_6
Honored Contributor

Re: /usr file system full

Hi,

You can look for these and clean them and try
/var/adm/crash
Look for everything
/var/adm, /var/adm/sa
look for large acct files
/var/mail
look for big mail files...
/var/spool
look for dead print jobs that are still there.
/var/adm/sw
delete the log files or make their size "0"
check /var/dt for unused configurations, old error logs, etc...

check the dot files under /, especially if your are running netscape!

The best tool to use is "/usr/bin/du".
cd /
du -sk *

This will show the use of all the directories!

Hope this helps

Thanks

James R. Ferguson
Acclaimed Contributor

Re: /usr file system full

Hi:

If you have any core files they certainly can be removed to regain space:

# find /usr -name core -exec rm -i {} \;

As for links between /usr and /var, there are several "transition links" that remap pre-10.x file system layouts to current standards. Most notably, there are links in /usr to /var, namely:

/usr/adm -> /var/adm
/usr/mail -> /var/mail
/usr/spool -> /var/spool
/usr/tmp -> /var/tmp

You will see transition links with a "t" as the last letter of the symbolic permissions, as for example "lrwxrwxrwt".

...JRF...
Shahul
Esteemed Contributor

Re: /usr file system full

Hi

Check for core files in /usr. If there delete it. Normally /usr will not grow like this. In ur case I think some unwanted link is there from /var. And U can trim the log file in /var/adm. Then see any difference is there or not.

Did U rebooted the system after this size hike? If not once U reboot and see. Problem may get solved.

If U are not getting any solution, checkup for free space in VG. If yes, Extend the /usr file system after booting thru lvm maintanence mode.

Best of luck

Shahul
Bernie Vande Griend
Respected Contributor

Re: /usr file system full

One more thing to add, some vendors (for reasons unknown) seem to insist that their software is installed in /usr instead of /opt or somewhere else. Check to see if any 3rd party applications are installed in /usr or even /usr/local. If so, I suggest making them a separate filesystem. It makes sense to do this for /usr/local if it is rather large as well. Doing a du -sk * from /usr is the best place to start to see where your space is being consumed.
Ye who thinks he has a lot to say, probably shouldn't.

Re: /usr file system full

Hi Idris,
you cann running the Program Cleanup for deleting old Version?s of Pathches and Sofware.
This can help You for obtaining free space on /usr.
the world of unix is beautifull
Deshpande Prashant
Honored Contributor

Re: /usr file system full

HI
Checking the usage by directory in /usr will be a good idea to start looking for space.
#cd /usr
#du -sk |sort -n

Any big applications in /usr may be considered for moving in a seperate file system.(even /usr/local)

If not consider extending it. What's your current size of /usr?

Thanks.
Prashant.
Take it as it comes.
Christopher McCray_1
Honored Contributor

Re: /usr file system full

Also, check under the /usr/old directory. I found a lot of previous versions of updated software hidden under there on an older server of mine in repeating newconfig directories. I was able to knock 5% off right there.

Hope this helps
Chris
It wasn't me!!!!
Jeff Gyurko
Frequent Advisor

Re: /usr file system full

All of these suggestions are valid. I usually start with the "du -s *" in /usr to find out which directory has the most space being consumed. I start looking for the largest of the numbers displayed. Remember that the output is given in 512 byte blocks, so multiply the number that you get by 512 to find approx MB being used.

If you find nothing of substance, I would then see if fsck can find some broken chains or file pointers, lost inodes, resource maps...
I have found fsck's that have recovered space in the 100's of MB. Do the fsck -n /dev/vg00/rlvol? to see if you have any corruption that fsck needs to fix. If you do, I would do it at the single user mode run level and clean it up. You may not be able to rely on the automatic check during reboot, so do it manually.

The other area, if fsck comes back clean is files that were removed, but the space being used by that file has not been returned because there is a process that still owns that space. A reboot would cure that also.

Keep us posted.
Magdi KAMAL
Respected Contributor

Re: /usr file system full

Hi Idris,

best command is :

du -k /usr ? more

This allows you to check the content of each directory and to lock where the suddent increase comes from.

Magdi