Hi Everyone,
My var directory is showing near to 100% ? What are the files should i delete to make it less??
Kindly suggest
# bdf -i
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol3 1048576 107616 933616 10% 3342 29394 10% /
/dev/vg00/lvol1 511672 60800 399704 13% 65 50111 0% /stand
/dev/vg00/lvol8 4194304 3997504 195320 95% 24916 6124 80% /var
hergp
October 13, 2011, 2:53am
2
To find the largest files in /var, try
find /var -size +20480 -ls | sort +6nr -7 | head
Thanx for the help.
But i'm getting the error in this,
# find /var -size +20480 -ls | sort +6nr -7 | head
find: bad option -ls
hergp
October 13, 2011, 5:04am
4
If HP-UXs find does not allow the -ls switch, then this should work:
find /var -size +20480 | xargs ls -l | sort +4nr -5 | head
1 Like
check for this too ..
$ du -ah | sort -r +4n | head
Yeah it works.,..,
Mentioned below is the output of the same:
# find /var -size +20480 | xargs ls -l | sort +4nr -5 | head
-rw-r--r-- 1 root root 77007636 Oct 13 11:51 /var/adm/syslog/syslog.log
-rw-r--r-- 1 root root 67092480 Apr 5 2005 /var/adm/crash/crash.2/image.2.2
-rw-r--r-- 1 root root 67080192 Apr 5 2005 /var/adm/crash/crash.2/image.2.1
-rw-r--r-- 1 root root 67076096 Apr 5 2005 /var/adm/crash/crash.2/image.1.1
-rw-r--r-- 1 root root 67067904 Apr 5 2005 /var/adm/crash/crash.2/image.1.2
-rw-r--r-- 1 root root 49475584 Apr 5 2005 /var/adm/crash/crash.2/image.1.3
-rw-r--r-- 1 root sys 36164214 Feb 5 2011 /var/opt/ignite/recovery/2011-02-05,23:17/flist
-rw-r--r-- 1 root root 33550336 Apr 5 2005 /var/adm/crash/crash.1/image.1.1
-rw-r--r-- 1 root root 33542144 Apr 4 2005 /var/adm/crash/crash.0/image.1.4
-rw-r--r-- 1 root root 33525760 Apr 4 2005 /var/adm/crash/crash.0/image.1.2
So,what should i delete from here??there are
/var/adm/syslog/syslog.log consumed a lot of space
Also other files in /var/adm path.,.,
hergp
October 13, 2011, 5:30am
7
I would delete the crash dumps under /var/adm/crash. Most likely, nobody will ever analyze them, especially if they are 6 years old
Then rerun the command and see, what comes up next. You might want to change the trailing "head" to "head -20" or "head -even_bigger_number" to see more files.
1 Like
Hi,
Thanx for the revert.
This is the output i get.
# find /var -size +20480 | xargs ls -l | sort +4nr -5 | head -100
-rw-r--r-- 1 root root 77007636 Oct 13 11:51 /var/adm/syslog/syslog.log
-rw-r--r-- 1 root root 67092480 Apr 5 2005 /var/adm/crash/crash.2/image.2.2
-rw-r--r-- 1 root root 67080192 Apr 5 2005 /var/adm/crash/crash.2/image.2.1
-rw-r--r-- 1 root root 67076096 Apr 5 2005 /var/adm/crash/crash.2/image.1.1
-rw-r--r-- 1 root root 67067904 Apr 5 2005 /var/adm/crash/crash.2/image.1.2
-rw-r--r-- 1 root root 49475584 Apr 5 2005 /var/adm/crash/crash.2/image.1.3
-rw-r--r-- 1 root sys 36164214 Feb 5 2011 /var/opt/ignite/recovery/2011-02-05,23:17/flist
-rw-r--r-- 1 root root 33550336 Apr 5 2005 /var/adm/crash/crash.1/image.1.1
-rw-r--r-- 1 root root 33542144 Apr 4 2005 /var/adm/crash/crash.0/image.1.4
-rw-r--r-- 1 root root 33525760 Apr 4 2005 /var/adm/crash/crash.0/image.1.2
-rw-r--r-- 1 root root 33525760 Apr 4 2005 /var/adm/crash/crash.0/image.1.3
-rw-r--r-- 1 root root 33525760 Apr 4 2005 /var/adm/crash/crash.0/image.1.5
-rw-r--r-- 1 root root 33525760 Apr 4 2005 /var/adm/crash/crash.0/image.1.7
-rw-r--r-- 1 root root 33525760 Apr 5 2005 /var/adm/crash/crash.1/image.1.2
-rw-r--r-- 1 root root 33525760 Apr 5 2005 /var/adm/crash/crash.1/image.1.3
-rw-r--r-- 1 root root 33525760 Apr 5 2005 /var/adm/crash/crash.1/image.1.5
-rw-r--r-- 1 root root 33525760 Apr 5 2005 /var/adm/crash/crash.1/image.2.2
-rw-r--r-- 1 root root 33521664 Apr 4 2005 /var/adm/crash/crash.0/image.1.1
-rw-r--r-- 1 root root 33521664 Apr 5 2005 /var/adm/crash/crash.1/image.2.1
-rw-r--r-- 1 root root 33509376 Apr 5 2005 /var/adm/crash/crash.1/image.1.4
-rw-r--r-- 1 root root 33501184 Apr 4 2005 /var/adm/crash/crash.0/image.1.6
-rw-r--r-- 1 root root 29154768 Apr 4 2005 /var/adm/crash/crash.0/vmunix
-rw-r--r-- 1 root root 29154768 Apr 5 2005 /var/adm/crash/crash.1/vmunix
-rw-r--r-- 1 root root 19544656 Sep 2 2008 /var/adm/crash/crash.2/vmunix
-rw-r--r-- 1 root root 16359424 Apr 4 2005 /var/adm/crash/crash.0/image.1.8
-rw-r--r-- 1 root root 14639104 Apr 5 2005 /var/adm/crash/crash.1/image.1.6
These all are the files in /var/adm/crash directory.
Can u please tell me is it OK to delete these files as i don't know about what are the crash files which gets generated.?
hergp
October 13, 2011, 6:05am
9
Crash dumps are created every time, the operating system panics.They are saved when the OS reboots so the cause of the crash can be analyzed. In your case, these dumps are over 6 years old and nobody will ever care about them.
These commands will delete all crash dumps on your system:
cd /var/adm/crash
rm -r crash.?
After that you will probably have enough free space on /var, so you won't have to bother with all the other files.
1 Like
vbe
October 13, 2011, 7:51am
10
That said, it could help to know with what you are dealing, by the look of things I doubt its a server or the guy who installed it was a bit nuts (absolutely not HP-UX standard...).
What OS version is it? It could help seeing if there is anything else that could be done, we cant give commands not knowing that... (looks like a very old OS if it is correctly installed (pre HP-UX 9...)
Hi hergp,
Thanx for the help.
After deleting the crash dumps under /var/adm/crash, it reduces a lot of space from 95% to 75 % now in /var directory.
# bdf -i
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol8 4194304 3126528 1059496 75% 24891 33349 43% /var
Thanx a ton
---------- Post updated at 11:19 AM ---------- Previous update was at 11:17 AM ----------
Hi hergp,
Thanx for the help.
After deleting the crash dumps under /var/adm/crash, it reduces a lot of space from 95% to 75 % now in /var directory.
# bdf -i
Filesystem kbytes used avail %used iused ifree %iuse Mounted on
/dev/vg00/lvol8 4194304 3126528 1059496 75% 24891 33349 43% /var
Thanx a ton