cancel
Showing results for 
Search instead for 
Did you mean: 

/var filling up

SOLVED
Go to solution
Tim Votta`
Occasional Contributor

/var filling up

I am filling in for the senior unix guy and have run into a problem.
The /var file system is approaching 100% and I need to remove some stuff. This machine is on it's way to being replaced but I ned it from the next couple of weeks.

Is is safe to rm file in the /var/adm/sw dir? For instance the PHCO_XXX.depot files.

Also in the /var/adm/sw/patch directory. Can I rm the directories there? They appear to be patches from 1999.

Any assistance you can provide is appreciated.
Here fishie fishie fishie
13 REPLIES
Uday_S_Ankolekar
Honored Contributor

Re: /var filling up

Hello,

No don't want to remove sw directory.
Instead look for big files in /var directory

Find files more than 1 GB
find /var -type f -xdev -size +100000000c -exec ll {} \;

You can also use du -sk command .

Look for /var/tmp directory Also check for old log files and remove them

-USA..
Good Luck..
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: /var filling up

Don't remove them that way; your installed software database will become corrupt. Instead, run the 'cleanup' utility. You will probably safely regain quite a bit of space.
If it ain't broke, I can fix that.
PIYUSH D. PATEL
Honored Contributor

Re: /var filling up

Hi,

Dont remove the /var/adm/sw directory. It will create lot of problems for you.

Lokk for the big files in the /var/adm/crash and you can delete the subdirectories and files in this directory.

Do
# cat /dev/null > /var/adm/wtmp
# cat /dev/null > /var/adm/btmp

Check for the logs and temp files and delete them.

Piyush
Helen French
Honored Contributor

Re: /var filling up

DONOT remove those files manually. As suggested you can run 'cleanup' command to do a patch cleanup on your system.

# man cleanup - for details.

Also check the bigger files with:

# cd /var
# du -k | sort -rn | pg
# find . -xdev -type f -size +10000 -exec ll {} \; > /tmp/big_files

Also trim the log files (/var/adm/wtmp, utmp, syslog.log, mail.log) and remove the core files ( /var/adm/cron) if not needed any more.
Life is a promise, fulfill it!
Helen French
Honored Contributor

Re: /var filling up

Oops... sorry :((

I meant /var/adm/crash ! and NOT /var/adm/cron.
Life is a promise, fulfill it!
PIYUSH D. PATEL
Honored Contributor

Re: /var filling up

Hi,

Also try
cd /var

#find . -type f -size +1000000c -exec ls -al {}\; | sort -rn > /tmp/bigfiles

This will show you the files with more than 1MB size.

Pls give the output of these files and we can suggest what files to remove.

Piyush
Sanjay_6
Honored Contributor

Re: /var filling up

Hi Tim,

Do not remove files from /var/adm/sw manually. Use the patch cleanup utility "cleanup" to clean the old patches from your system. The utility is available as a patch which you can download and install on your system. The cleanup patch is availble as

patch PHCO_20824 for 10.20
patch PHCO_24347 for 11.0

You can also look into the var filesystem and clean these files.

Anything under /var/adm/crash
old files under /var/opt/hparray (files starting with L , Delete the old ones only.

Hope this helps.

Regds
Brian Crabtree
Honored Contributor

Re: /var filling up

I dont know if you are running a database on the machine, but...

If you are running Oracle, and using the RMAN plugin with the Omniback software and a catalog database, this software automaticlly puts export dumps of the catalog database into /var/opt/omni/tmp. These files are mostly worthless, and can be cleaned up for space.

Brian
Sebastian Galeski_1
Trusted Contributor

Re: /var filling up

Hi
as above don't erase /var/adm/sw,
did You check system logs files? If not run sam -> routine tasks -> system log files and have a look on size of this log files, trim them it should give You some free space.
Maybe in /var/adm/crash there is a core dump file, You can erase it.

If You check everything and find nothing to erase, but You have free space on other filesystem You can move something from /var to this filesystem and create a link on /var to it.

hope it help
Tim Votta`
Occasional Contributor

Re: /var filling up

Thanks for the help. As it turns out, I had to remove something quickly because I was at 100%.
I rm an old file /var/adm/sw/PHSS_14405.depot (38 MB)

Currently I have 96% of /var available. I have read up on the cleanup command and it sounds like a good move for my situaiton. As I read it using the command with no switches would remove superseded patches.

Are there any gotcha's I should be aware of if I run this?

Also since I already removed a .depot file do you think this would cause a problem. I do have a backup of the .depot file.

Thanks for your feedback.
Here fishie fishie fishie
Helen French
Honored Contributor

Re: /var filling up

There will not be any issues if you run the cleanup command. Read the man pages before you start this command and decide which level you want to keep your patches. You will get necessary free space after running this.

Removing patch.depot file from the /var/adm/sw directory is NOT recommended! I would do a cleanup command first and then if safe, remove any unwanted patches with 'swremove' command. Did you check the following possibilities too ?

1) /var/adm/crash
2) system, mail log files
3) wtmp, utmp
4) stm logs
Life is a promise, fulfill it!
MANOJ SRIVASTAVA
Honored Contributor

Re: /var filling up

Hi Tim


Dpeot removal is not a good way to regain sapce , as you must be having space after eh depot was installed . I would follow the following path :

1. cleanup ( no problems ot gotchas ).
2. /var/tmp
3. /var/mail
4. cat > wtmp
4 all logs like stm , adm/sulog syslog , spool etc.

You may like to look at this document too :

http://www.netrunner.nu/~rogers/system_administration/Principles_of_system_administration.pdf
Angus Crome
Honored Contributor

Re: /var filling up

If you use Omniback for tape backups, you should check /var/opt/omni/log on that system. It may be running in a heavier debug mode than normal and filling up space quickly. If you don't use Omniback, then please disregard.

The above statement is more for future searchers.
There are 10 types of people in the world, those who understand binary and those who don't - Author Unknown