Operating System - HP-UX
1834882 Members
2385 Online
110071 Solutions
New Discussion

maintaining root filesystem

 
SOLVED
Go to solution
Sanjiv Sharma_1
Honored Contributor

maintaining root filesystem

Hi,

I have an rp8400/HP-UX 11i.

My root filesystem is 99% full. Now I am not able to figure out which all files are occupying spaces in root.

Generelly foor the other filesystem like say /var. I use.
# du -a /var | sort -nr | more

Kindly let me know the best possible way to identify the unwanted files under root filesystem.

Thanks,
Everything is possible
4 REPLIES 4
Tim Adamson_1
Honored Contributor
Solution

Re: maintaining root filesystem

A quick check is to look at /dev/rmt and see if you have a large file called om in there. Many people mistakenly use om instead of 0m and backups will go to disk instead of tape and fill / (root)

Other than that, you will can check for large files as follows:

# find / -xdev -size +10000c -exec ls -l {} \;

That will show you all the files in / over 10Mb. You can change the size to suit your purposes.


Tim.
Yesterday is history, tomorrow is a mystery, today is a gift. That's why it's called the present.
Con O'Kelly
Honored Contributor

Re: maintaining root filesystem

Hi Sanjiv

I'd normally use:
# du -kx / | sort -rn | head -30
This will output the top 30 largest files/directories in root fs.
The "-x" limits the search to the / FS.

Common causes of root FS filling up include:
- core files
- incorrect tape device specificied for backup (check /dev/rmt directory)

Cheers
Con
Sridhar Bhaskarla
Honored Contributor

Re: maintaining root filesystem

Hi,

I usually use

find / -xdev -type d |xargs du -sk |sort -n|tail -10

to find the top 10 directories with respect to size. -xdev will exclude filesystems so you will get only the directories under / filesystem.

You can also use -size option with find along with -xdev to find the files of more than particular size.

Below are few cases why your root filesystem may get full

1. Due to directories under / that are not filesystems but owned by other users.
2. Core files. You can find them out by using find command

find / -xdev -name core -print

3. /etc/rc.log. Some application may tend to write their logs into rc.log if started through sbin/init.d scripts. You can find them out by "fuser" command.

4. Device files created as normal files. Like 0m, null, log etc.,

5. /etc/lvmconf. If you have too many filesystems and volume groups, this may become large. Check the size on it.

6. /etc/cmcluster. Again, applications started through serviceguard may tend to write error messages into the log files in this directory. This may create problems to root file systems sometime.

Keep a root window open on this system. Otherwise, if it becomes 100%, then you will need to reboot the box into single user mode to correct the issue.

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

Re: maintaining root filesystem

Check out this recent question: http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x79e46933fb5d45439a142af8db73d1c6,00.html

The root filesystem can fill up with a few large files but it is much more important to locate large directories. 10,000 small files in a junk directory is just as bad as a few big files.


Bill Hassell, sysadmin