Operating System - HP-UX
1830895 Members
1795 Online
110017 Solutions
New Discussion

how to add space to /var directory - urgent

 
SOLVED
Go to solution
vas  bolpali
Advisor

how to add space to /var directory - urgent

hello,
on of our file system directory on HP-UX 11.0 was full.
by 'bdf' command returns as follows
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol8 516096 516015 81 100% /var


how to increase the space for '/var'with out any disturbence.
note we can't get in 'SAM- file system'
thnx
vasu
keeping you ahead of the learning curve
8 REPLIES 8
Sridhar Bhaskarla
Honored Contributor
Solution

Re: how to add space to /var directory - urgent

Vasu,

You can do few things now to temporarly get rid of it.

Identify a file system that has free space and copy /var/adm/sw/save into it and link it from /var/adm/sw directory.

#mv /var/adm/sw/save /another_filesystem/varadmsave
#ln -s /another_filesystem/varadmsave /var/adm/sw/save

Check your /var/tmp and clean up the big files.

Check /var/mail directory and delete unnecessary mail files.

When you get a chance to reboot the system, get it into single user mode and increase the /var file system.

If you have onlineJFS, you can increase /var on the fly.

lvextend -L new_size /dev/vg00/lvol???
fsadm -b new_size_in_blocks /var

new_size_in_blocks=new_size*1024

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

Re: how to add space to /var directory - urgent

Hi
Check big files in
/var/adm/sa
/var/mail
/var/tmp
/var/tombstones
/var/adm/crash
/var/preserve

If possible delete/move/zip them.
You can also use cleanup utility to commit some patches.
#cleanup -p -c 2 :- to list patches superseeded twice atleast.
#cleanup -c 2 :- to commit patches superseeded twice atleast. This will free up some sapce by deleting save file sets for those patches in /var/adm/sw dir.

Good luck
Prashant.
Take it as it comes.
James R. Ferguson
Acclaimed Contributor

Re: how to add space to /var directory - urgent

Hi Vasu:

In addition to the suggestions already made:

> Look for any 'core' files.
> Remove files in /var/preserve (old vi recovery files).
> Remove files in /var/tombstones (except 'ts99' which is the most *current*).
> run 'cleanup' [see the man pages *first*]

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: how to add space to /var directory - urgent

Most likely, there are 1 or 2 directories causing the problem (NOT necessarily due to big files but just lots of files). Find the big directories:

du -kx /var | sort -rn > /tmp/du.var

Now look at the top lines in /var..what are the biggest directories? Is it:

/var/mail -- (someone got a giant email)
/var/spool -- (someone is printing a massive file)
/var/adm -- (probably a big logfile)
/var/adm/syslog -- (definitely a big logfile)
/var/adm/sw -- (patches, but cleanup will require space in /var)
/var/tmp -- (someone has a bunch of big files in /var/tmp)

Make note of what happened as you will probably have to go back again (and again...) until you fix the problem. /var is the most critical directory in the system since if it gets full, almost everything stops running (mail, spooling, logging, etc)

DOn't increase /var until you put the brakes on unnecessary files (a cron job to remove or trim them)


Bill Hassell, sysadmin
Uday_S_Ankolekar
Honored Contributor

Re: how to add space to /var directory - urgent

Hi
to get large files by some number

find /var -size +10000c -exec ls -l{}/;

or you can try

du -kx |awk -F/ `NF==2` | sort -n

also trim syslog.log and mail.log file in /var/adm/syslog directory

Good luck

-USA..

Good Luck..
Bernie Vande Griend
Respected Contributor

Re: how to add space to /var directory - urgent

One more trick after you check all of the above suggestions. If you decide you still need more space in /var can't expand it or don't want to bring the system down, you could split a sub directory of /var into its own filesystem. Just mount the new filesystem to a temporary location, move the files over and mount the new location (stop any service that writes to that location first.
This works well with things like Measureware which writes its large datafiles to /var/opt/perf/datafiles.
Ye who thinks he has a lot to say, probably shouldn't.
vas  bolpali
Advisor

Re: how to add space to /var directory - urgent

Hi all,
we solved the problem .
we get rid of some files from
/var/adm/crash directory. our system was crashed more than once recently , because of power failures, which creates big files in that directory.
thank you all for your reply.
keeping you ahead of the learning curve
Mark Vollmers
Esteemed Contributor

Re: how to add space to /var directory - urgent

Vasu-

Depending on if you want to keep these crash files or not, you can prevent them from being created. The startup script is savecrash (I can't remember where the file is that you specify where to run it), but just change the value to 0 from 1 and it will stop making these every reboot. Of course, the danger is that you will not be able to use the crash file to determine why it crashed. You could also set up a cron job to clean these out monthly or whatever. It will help to prevent problems in the future.

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"