Operating System - HP-UX
1827485 Members
2280 Online
109965 Solutions
New Discussion

Re: filesystems filling up

 
Nial Gunn
Frequent Advisor

filesystems filling up

I have several machines Running NNM7.01 on HPUX11i which I took over from a colleague the problem is that the /opt and /var filesystems mounted on lvol4 and lvol7 seem to be filling up and causing problems. I have increased the sizes on a couple of the boxes but they keep filling up. I am unsure what is causing this and if I can delete any files to free up some space.
9 REPLIES 9
Simon Hargrave
Honored Contributor

Re: filesystems filling up

Try and find the biggest "area" on the filesystem.

An easy way to track down heavy filesystem usage is to: -

change directory to the base of your filesystem, eg /opt

df -sk * | sort -n

this shows the size of the directory trees within so you can identify the largest one(s)

change directory to the largest and do the df again, until you find the largest single entity.

Post back your results and we may be able to help whether you can delete or not.
RAC_1
Honored Contributor

Re: filesystems filling up

du -skx /var | sort -nk1
du -skx /opt | sort -nk1

Will give you the list of the files that are using most of the space. Check those files and see why they are growing.
There is no substitute to HARDWORK
Cem Tugrul
Esteemed Contributor

Re: filesystems filling up

As an addition to other replies;

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=19566

Good luck,
Our greatest duty in this life is to help others. And please, if you can't
Eknath
Trusted Contributor

Re: filesystems filling up

Hi Nial

Possibly log files are creating problems. To verify find the latest modified files. or else use
#find . -size +5000000c -xdev -exec ll {} \;

to find files larger than 5MB. This should help

Cheers !!!
eknath
Jon M Zellhoefer
Valued Contributor

Re: filesystems filling up

If you can't find anything that's the obvious cause, try using lsof to see if there is a file "reserve" causing the inode table to think the fs is filling up.
Ranjith_5
Honored Contributor

Re: filesystems filling up

Hi,

Try to find out the recent large files . The following script will help you.

#This script finds recenty created large files
#
#Author : Syam
#Version : 1.1
#Date : 26/01/2005
#
#
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


Regards,
Syam
Bill Hassell
Honored Contributor

Re: filesystems filling up

Whenever you take over any computer system, the first task is to monitor disk space. Unless special software has been written to limit the size of logfiles, all copmputer systems will fill up all the disks forever...

So don't bother extending /var. It's full of logfiles that first need to be read...you may have serious hardware failures and the logs are yelling at you to fix the problem. Start with analyzing the size of /var and see where most of the space is used:

du -kx /var | sort -rn | head -20

If you see that /var/adm is the largest subdirectory, look inside at the size of the files:

ll /var/adm | sort -rnk5 | head -20

Since there are dozens of logfiles, you'll need to post the names of the files. And always look at syslog on a regular basis (daily is good). /var/adm/syslog/syslog.log is the file. It may hundreds of megfs in size (that's bad and an indication that you have problems to fix). Look also at /var/adm/syslog/mail.log and if it is large, your email is misconfigured.

Or the largest directories are in some other location. Post the results of the du command above and we can suggest what to do.


Bill Hassell, sysadmin
Leif Halvarsson_2
Honored Contributor

Re: filesystems filling up

Hi,


Check which applications that is installed and, where they are installed. /opt is normally used for binary files, and should change very little. /var may increase but, under normal conditions, also this volume should increase rather slow.

It is a common praxis, when installing more complex applications, to create separate volumes for the application.
rveri
Super Advisor

Re: filesystems filling up

Hi Nial ,

Hope this command will help you to find out the largest files and deciding to trim the filesystem or not , and what is filling up the space :

1]
# cd /filesystem
# ls -lR | sort +4 -5nr | more
----------


2]If there is a number of mountpoints on this directory use the -xdev argument with find option.

# cd /filesystem
# find . -type f -xdev -exec ls -l {} \; > output.txt ; cat output.txt | sort +4 -5nr > outfinal.txt ; rm output.txt

Check the final.txt for the largest files in serial order. And u can decide which is filling up the space, and can free up space.


Cheers,

R.Veri.
------