Operating System - Linux
1753753 Members
5359 Online
108799 Solutions
New Discussion юеВ

Re: what's filling up my root partition????

 
fred mudgett_2
Occasional Advisor

what's filling up my root partition????

Greetings, I have a root partition which should has been being filled up aggressively lately. Is there an ls command which can list the files by size?

Thanks,
Fred
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: what's filling up my root partition????

Shalom Fred,

cd /

du -k | sort -rn | more

ls -lrt may be helpful.

This will give you an idea where the full stuff us.

Look for regular files in /dev/rmt

Its quite common for junk to end up there with typos in attempts to tar data to tape.

The old hidden file trick.

mkdir /filesystem
copy 100 MB to it.

mount a filesystem on folder /filesystem

Now the 100 MB are on the root fs and invisible until you umount the filesystem.

If for example /var fails to mount once and log files write to root for a while and then there is a reboot you have many mega of files that are invisible to all.

If all other attempts to find the files fail then boot to single user mode and have a look around.

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
Alexander Chuzhoy
Honored Contributor

Re: what's filling up my root partition????

find / -type f -size +100M
will list files of 100MB and more.
I'd do
`du -hs /` first in order to find out what directory is using the space-just to narrow the search path for find command.
Huc_1
Honored Contributor

Re: what's filling up my root partition????

Same but with human file size.

find / -type f -size +100M -exec ls -lh {} \;

Jean-Pierre Huc
Smile I will feel the difference
Bill Thorsteinson
Honored Contributor

Re: what's filling up my root partition????

Find the offending directory as follows

cd /
du -s * .??* | sort -n

Ignore mounted systems and pick the diretory
with the most space used. eg. /tmp

cd /tmp
du -s * .??* | sort -n

This should help finding where the space is
going.

You won't be able to see files hidden by
a mount point.

Consider bringing your system up with a
recovery boot disk.
Check each mount point to ensure it
is empty. Then change the mode to 000.
This will prevent files from being
created in the directory when the
file system is unmounted.

Newer kernels have a bind mount that
allows you to access the directory hidden
by the mount. It is used by udev.

If you aren't using udev, devfs, or other
systems that dynamically create /dev entries
consider removing write access to the
directories in the /dev tree.
fred mudgett_2
Occasional Advisor

Re: what's filling up my root partition????

Thanks for the answers everybody! I think I found the problem... and of course it was me.
fred mudgett_2
Occasional Advisor

Re: what's filling up my root partition????

Thanks!