1821584 Members
3426 Online
109633 Solutions
New Discussion юеВ

Root File system full

 
susee
Advisor

Root File system full

Hi Everybody

Currently one of my hp servers , the root filesystem is getting increased (95% ) , as per our agreemnt to the customer the root file system should be maintained below 90 % ,
when i use ls -lR with sort option it shows all the files under mounted directory too

since the / file system has all important files under it , i am unable to identify which file shoud i remove or trim for that

i also didnt find any core files under the file system

could any one suggest me to find the unwanted files under / and any thing can be done on the the softwares or patches so that i can limit the space
17 REPLIES 17
Arunvijai_4
Honored Contributor

Re: Root File system full

Hello,

Can you post these ?

1) # ls -lR | sort +4 -5nr | more
2) # bdf

To clean patches installed on your server,
# cleanup -c 1

-Arun


-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Robert-Jan Goossens
Honored Contributor

Re: Root File system full

Hi,

Could you post the results from

# bdf /
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 255253 26385 203342 11% /

# du -kx / | sort -rn | head -20
26229 /
19968 /sbin
5886 /etc
3824 /sbin/fs
2776 /etc/opt
2637 /etc/opt/resmon
1717 /sbin/fs/vxfs
1614 /sbin/fs/hfs
1058 /etc/lvmconf
1024 /etc/opt/resmon/lbin
981 /etc/opt/resmon/lib
559 /etc/opt/resmon/log
553 /sbin/lib
525 /etc/X11
458 /etc/hpC2400
438 /sbin/init.d
302 /root
225 /sbin/fs/cdfs
205 /root/.sw
201 /root/.sw/sessions

Regards,
Robert-Jan
Jeff Schussele
Honored Contributor

Re: Root File system full

Hi susee,

Get to / & run this command

du -akx | sort -rn | more

THe "x" is important as it will restrict the search to the / filesystem only.
This will list the biggest files/dirs at the top of the output - hence the | more

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
baiju_3
Esteemed Contributor

Re: Root File system full

Hi Susee ,

Can use find command..

find . -xdev -size +1000000c -exec ls -ld {} \;

This will print files greater than 1Mb , you can make your search futher narrow by
increasing the file size in the search string .

Regards ..bl.
Good things Just Got better (Plz,not stolen from advertisement -:) )
Pete Randall
Outstanding Contributor

Re: Root File system full

The only things that should exist under / (that aren't mounted file systems) should be:

/sbin/
/dev/
/etc/

One of the most common causes for root filling up is someone doing a backup to a non-existant device, like /dev/rmt/Om (the letter "O" rather than the number "0"). A core file would also fill things up rather quickly. And very rarely something will get written underneat a mount point, like someone writing a large file to /home when /home is not mounted.


Pete

Pete
Bill Hassell
Honored Contributor

Re: Root File system full

ls -LR is the wrong command. The root filesystem is static and will not grow unless a root administrator has made a mistake. Don't look for big files -- look for big directories. Use this command and post the results:

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

The largest directories will be /etc and /sbin. If you see anything else at the top of the list, it needs to be moved. Note that the cleanup command only modifies /var/adm/sw, not the root filesystem (unless /var is part of root and doesn't showup in bdf)


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: Root File system full

Shalom,

Note that space can be taken up in a hidden way in root:

1) A process can remain open on a file that has been deleted. In this case the space is not deleted.

2) Files can be hidden because the folder they are in now have a filesystem mounted on them.

Lets say the /schmo folder ahd 54 MB of files in it prior to:
mount /schmo
Now those files are taking up space on root and can not be seen or deleted.

The old hidden file trick.

Now to fix it, you umount /schmo and clean up.

It becomes a harder task when the /var or other filesystem has this issue. Then you have to look at things with nothing mounted in single user mode.

boot
intervene at the 10 second prompt
bo
Y Interact

hpux -is

cd /usr
ls -la
Mothing should be there
cd /var
ls -la

If possible run the du -sk | sort -rn | more command. You may need to mount /usr to do this. Ignore large files in /usr if that is required.

Clean up files that do not belong in folders mentioned as mount points in /etc/fstab

boot again.

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
Geoff Wild
Honored Contributor

Re: Root File system full

Largest dirs should be:

/etc/lvmconf
/etc/vx

and /etc/cmcluster if running MC/SG

Jeff's du -akx command works great - except instead of more - just normal sort:

du -akx |sort -n

and largest will be on the bottom

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Chan 007
Honored Contributor

Re: Root File system full

Hi,

Checks log files in /var/adm/syslog/*.log, gzip them.

Also check in /etc/lvmconf/ for any old conf files..!!

Check whats others said..!!

Chan
DCE
Honored Contributor

Re: Root File system full


Susee

you might want to check for a large file under the /dev/rmt area. Sometimes a tape backup command is entered wrong and the backup does to the file instead of the tape.........


susee
Advisor

Re: Root File system full

Hi Every one

here is the output

du -kx / | sort -rn | head -10
178264 /
120696 /etc
72336 /etc/lvmconf
37912 /sbin
26696 /etc/vx
21656 /etc/vx/type
16408 /etc/opt
13080 /sysinfo
10984 /etc/opt/resmon
8616 /etc/vx/type/static
----------------------------------------
bdf /
/dev/vg00/lvol3 204800 184352 20352 96% /
----------------------------------------

the ls -lR with sort and du command will show the other mounted files also

is there any other suggesstions where i can solve this problem

Many Thanks & regards
Susee
Bill Hassell
Honored Contributor

Re: Root File system full

/etc is quite large. Let's see what the biggest files are:

ll /etc | sort -rnk5 | head -20

The largest directory in /etc is lvmconf. Does this system have dozens of volume groups? If not, sort the lvmconf directory like this:

ll /etc/lvmconf | sort-rnk5 | head-20

The results of these two commands will be very helpful.


Bill Hassell, sysadmin
Jeff Schussele
Honored Contributor

Re: Root File system full

Hi (again) Susee,

Take a look in /etc/lvmconf.
If you have a lot of VGs you may also have a lot of vg.conf.old files
They can be quite large - 100s of KB or even greater then 1MB.
These can usually be safely removed because they're not current. Just make sure you *do* have current files.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Chan 007
Honored Contributor

Re: Root File system full

You have more junk in /etc and /etc/lvmconf

in /etc
type ls -lrt (find the junk)

ls -lrt |grep ^d, to see which is the directory that has more junk created recently.

Move them to /var/adm/crash for timebeing.

Chan
MarkSyder
Honored Contributor

Re: Root File system full

If you have junk I would not advise you to move it to /var/adm/crash - you might need that if the system crashes.

I tend to set up a small filesystem called /safe for stuff that appears to be junk. If in doubt, I move the files to /safe and delete them if no one has screamed after a year.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Raj D.
Honored Contributor

Re: Root File system full

Hi Susee ,

You can use xdev option with find to get all biggest files under root.

# cd /
# find . -type f -xdev -exec ls -l {} \; > out.txt
# cat out.txt | sort +4 -5nr > out1.txt

Check the out1.txt for biggest files and they will be in serial order from biggest size.


btw ,
you can also check /etc/lvmconf/*.old files. Many times it occupies space , and *.old files can be moved to other place , and some space can be freed up.


Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Muthukumar_5
Honored Contributor

Re: Root File system full

Try this:

# du -x / | sort -rnk 1 | more

It will give disk usage based report for that root (/) file system only.

--
Muthu
Easy to suggest when don't know about the problem!