1833723 Members
2815 Online
110063 Solutions
New Discussion

/var full

 
SOLVED
Go to solution

/var full

Good mornig
I have a problem. If I run the command "bdf /var", it outputs:

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol8 5111808 5052688 58712 99% /var

Bur du -sk is: 1794504

I rebooted a lot of time, but it doesn't solve the problem.

Can someone help me?
Fabrizio
18 REPLIES 18
Arunvijai_4
Honored Contributor

Re: /var full

Hi,

Find out what is occupying more.

# du -skx /var/* | sort -nr | head -10

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
melvyn burnard
Honored Contributor

Re: /var full

check for unwanted dumps under /var/adm/crash.
Also, if you have installed patches and no longer wish to keep copies for the ability to remove them, you can check how much space is in use under /var/adm/sw/save, and if ti is large then use swmodify to commit these patches or just remove the subdirectories under this directory
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
john korterman
Honored Contributor

Re: /var full

Hi,

try
sam-->Routine Tasks-->System log files
and reduce the size of some of the logfiles.


regards,
John K.
it would be nice if you always got a second chance
rariasn
Honored Contributor

Re: /var full

Hi Fabrizio,

# find /var -xdev -type f -exec ll {} \;| awk '{ printf "%9d %3s %2d %5s %s\n" , $5, $6 , $7, $8, $9 }'|sort -r -n > /tmp/var.txt &

# more /tmp/var.txt

Others tasks,

Modifify /sbin/clean_tmps and /etc/rc.config.d/clean_tmps, for delete files in directory /var/tmp afther reboot.

Verify file /sbin/clean_adm and /etc/rc.config.d/clean for others clean files.

rgs,

ran
Ninad_1
Honored Contributor

Re: /var full

Hi,

Usually the difference in sizes shown by bdf/df and du (Usually du shows lesser than df in such cases) is because some process opens a file and then terminates before closing the file leaving the space unreleased.
But once you reboor these should more or less tally.
Next thing is how you check /var using du -
it should be du -skx /var (Because usually there are other filesystems mounted in /var like /var/tmp , /var/adm ...), if you just use du -sk it will show disk usage by all files/directories under /var DIRECTORY and will not show the disk usage of files/directories in /var FILESYSTEM.

Now solving the problem as already suggested above, check for crash files, core files
find /var -xdev -name core
Also
du -sk /var/* | sort -nr | more
to check highest disk using directories - but then you need to check that they are not seperate filesystems and are infact files/directories in /var filesystem .
And cleanup unwanted stuff.

Regards,
Ninad
Ninad_1
Honored Contributor

Re: /var full

Hi,

Heres a script which will show highest disk using directories in /var FILESYSTEM (as /var DIRECTORY may contain various filesystems which you need not see as /var FILESYSTEM is full )

du -sk /var/* | sort -nr| while read dirsize dirname
do
if [[ $(bdf $dirname | grep -c '/var$') != 0 ]]
then
echo $dirname $dirsize
fi
done


Regards,
Ninad
spex
Honored Contributor

Re: /var full

Fabrizio,

You might also find it helpful to look at files which have been recently created/modified:

# find /var -xdev -type f -mtime -3 -exec ll {} \; |sort -k5

Also have a good long look at the contents of /var/tmp.

PCS
Doug Burton
Respected Contributor
Solution

Re: /var full

Some places to check that haven't been mentioned...

/var/adm/syslog
/var/adm/lp
/var/mail
/var/adm/wtmp (to big?)
/var/adm/lp/log
/var/spool/lp/request
/var/spool/cron/tmp
/var/sam/log
/var/spool/mqueue
lost+found (found in any mounted file system)
Did you mount a filesystem *ON* another filesystem in /var (thus hiding what's underneath)?
Remove core files in /var?

Re: /var full

No core files, no file with a great size...
The system (HP-UX 11.23 Itanium) is new, only few weeks of life...
No software installed, only OS.
rariasn
Honored Contributor

Re: /var full

More,

get space in /var/adm/sw/save,

# cleanup -p -c 2 (previous)

# cleanup -c 2 (commit)

rgs,

ran



Torsten.
Acclaimed Contributor

Re: /var full

If you have available space in your vg00, consider to increase lvol8. Really no large files found?

What gives

cleanup -p -c 2

(this is preview mode only)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   

Re: /var full

I have 4 identical server. The used space under /var is the same, but on only one server the bdf command says /var at 99%.
The used space in /var/adm/sw/save is the same for all servers. So this is not the problem...
spex
Honored Contributor

Re: /var full

Fabrizio,

According to your 'bdf' output, you have 58,712 kbytes free. What happens if you create a 60,000 kbyte file? Does the /var filesystem fill up?

prealloc /var/tmp/foo 60000000

PCS

Re: /var full

File system full...

No space left on device.
Ninad_1
Honored Contributor

Re: /var full

Fabrizio,

Did you try running the script I gave you to show max space occupying directories ?
Any clue from that on where is the space going ?
I also suggest you to run lsof to see list of open files to check which files in /var are open to get a clue if there is a big file not being closed by a dead process.
You can install lsof from
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.77/

Regards,
Ninad
spex
Honored Contributor

Re: /var full

Fabrizio,

Please post output of:

du -skx /var/* | sort -nr | head -10

find /var -type f -xdev -size +5000000c -exec ll {} \;

PCS

Re: /var full

First output:
du -skx /var/* | sort -nr | head -10
1670904 /var/adm
82480 /var/opt
22768 /var/jail
17128 /var/stm
616 /var/vx
264 /var/sam
128 /var/tmp
120 /var/spool
104 /var/tombstones
96 /var/yp

Second output in attachment.
James R. Ferguson
Acclaimed Contributor

Re: /var full

Hi Fabrizio:

This would seem to fit either the case of (1) a process that has created a file and unlinked (removed); and the process is still running [a common technique]; or (2) an over-mounted filesystem.

Using 'lsof' or even a combination of 'fuser' (to find processes using '/var') and 'glance' to view open files by the processes using '/var', might prove fruitful for case-1.

For case-2, run 'ncheck' and look for paths that should not appear beneath '/var':

# ncheck -F vxfs /dev/vg00/lvol8

Regards!

...JRF...