1844080 Members
4070 Online
110227 Solutions
New Discussion

Re: Root 100%

 
SOLVED
Go to solution
Shem_1
Occasional Contributor

Root 100%

What can I clear off to get some free space without adverse effect?
Port 80 on HP-UX 11.0
14 REPLIES 14
Michael Steele_2
Honored Contributor

Re: Root 100%

If / is 100% then try these commands:

# find /dev -type f

# find / -xdev -ctime 0 (* files accessed today *)

du -x / | sort -rn | more (* list largest first *)

Support Fatherhood - Stop Family Law
Con O'Kelly
Honored Contributor

Re: Root 100%

Have a look for any core files
find / -type f -name "core" -xdev -print

Core dump files can quickly fill / filesystem.

Cheers
Con
Steven E. Protter
Exalted Contributor
Solution

Re: Root 100%

This is an extremely serious situation and can quickly render your server useless and in need of disaster recovery.

Follow the previous advice and if possible shut down oracle and everything else running on this machine until the situation is resolved.

Running an 11.00 system like this can lead to the /etc/group or /etc/passwd file being hammered and dropped to zero bytes.

Running an 11.11 system can like this can result in the system suddenly refusing logins.

Another place to look for big files is /dev/rmt

You should see a bunch of files that look strange with ll or ls -la command. Those are tape drivers.

A common mistake when archiving to tape with say cpio is to direct the output to /dev/rmt/Om instead of zerom 0M

This can create a large file that quickly fills the root filesystem.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fragon
Trusted Contributor

Re: Root 100%

Hi,
Are there any file(s) really necessary to be put on /? Just get rid of some unnecessary file(s) follow the way given by Steel & Con. You always should put file(s) to a mount point first.

BTW,please assign points to others who really help you! ..."This member has assigned points to 0 of 30 responses to his/her questions."

-ux
twang
Honored Contributor

Re: Root 100%

2 ways to get more free space:
- remove some unnecessary files, such as core dump, very large logfiles...
# find / -xdev -size +1000 -depth -print
- check how much "Free PE" on vg00 could be allocated to lvol3(/)
# vgdisplay /dev/vg00
Punithan
Advisor

Re: Root 100%

Hi Shem

i been face the same problem....
and i try with this script and it help me lot.
System Engineer
Shem_1
Occasional Contributor

Re: Root 100%

Thanks guys for the feedback.

Are you suggesting that I should delete these files?
Port 80 on HP-UX 11.0
Con O'Kelly
Honored Contributor

Re: Root 100%

What files are you talking about?
If you mean core files, then yes its OK to delete them. I would be very careful removing any other files from / Filesystem unless you know what they are.

If you post the name of the files that you believe are causing the problem then I'm sure someone can advise you.

Cheers
Con
Bill Hassell
Honored Contributor

Re: Root 100%

Here is the fastest way to locate large areas that need attention (notice I didn't say large files?):

du -kx / | sort -rn | head -20

This will give you a list something like this (for a 'normal' root directory):

29213 /
18979 /sbin
8586 /etc
6345 /etc/opt
3676 /sbin/fs
3259 /etc/opt/samba
3235 /etc/opt/samba/codepages
2733 /etc/opt/resmon
1657 /sbin/fs/vxfs
1585 /root
1550 /sbin/fs/hfs

(I didn't paste anything smaller than 1000kb)

So / is only 29megs and /sbin is 19megs, pretty typical. If ANY directory pops to the top larger than that, then look inside the directory for big files. /etc is a common one because a spelling error can create massive files by accident. /etc should be about 8-12 megs.

Another common problem are bad applications that store themselves in / instead of /opt or /usr. These apps need to be moved and if the aqpps can't run properly in the correct directory structure, use symlinks to fool the app.

You can remove all core files. You may also find giant files in / because this is the (terrible) default location for root's home. It is best to create a separate /root or perhaps /home/root in order to keep root 'droppings under control. The sysadmin ideal is to NEVER allow ordinary files in /, just directories and mountpoints.

Post the contents of some big directories and we can tell what to do with the files.


Bill Hassell, sysadmin
Fragon
Trusted Contributor

Re: Root 100%

To twang,
You said "- check how much "Free PE" on vg00 could be allocated to lvol3(/)", do you mean extend / FS?
I think it's difficult and hardly success!
In my mind, if / is full, just one way(99%):rm or mv!
Have a good day!

:p
-ux
Steven E. Protter
Exalted Contributor

Re: Root 100%

The key point in Bill's post is that we need to see the files to know which ones to delete. Almost every root full situation is a little different.

Nothing you find other than core files is automatically delete bait.

In addition, its possible your search will lead to no files.

If a file gets copied into a folder while its not mounted and then it gets mounted later its invisible.

Example.

Got a folder(directory) called /steve/
I copy in a 50 Mb depot file called steve.depot

cd /steve
ll
-rwx------ steve.depot 500000000

Then I say mount /dev/vg01/lvol9 /steve
cd /steve
ll
Nothing shows.

The space however is still allocated.

What is more common in these situations is a filesystem like /var fails to mount and logs get written to root. You reboot the system and don't even know it happened some time.

How to fix:?

boot to single user mode.


shutdown -ry now

Interupt the startup at the 10 second prompt

bo

Y Interact with the ISL

hpux -is

Now you are in single user mode.

nothing is mounted.

cd /usr

ls -la

mount /usr

Do this so normal utilities start to work.

cd /var

ls -la

You shouldn't see anything.

cd /steve

ls -la

You should see the magic disappeared steve.depot

Good Luck.

SEP

The
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sritharan
Valued Contributor

Re: Root 100%

Hi,

You can use the du -k command to check which are the large files,

also can use the find / -xdev -ctime xx to check which are the files that been accessed for xx days

Thanks & Regards
SRi
Known is a drop...unknown is an ocean -> quote from a movie
Caesar_3
Esteemed Contributor

Re: Root 100%

Hello!

Check for core files, some temp files that
leaved on the lv.
Check files than not have to be on the /

Caesar
Pete Randall
Outstanding Contributor

Re: Root 100%

People:

This thread is a MONTH OLD!!

I certainly hope Shem has fixed his problem by now.


Pete


Pete