Operating System - HP-UX
1833788 Members
2254 Online
110063 Solutions
New Discussion

Freeing space on / (root)

 
SOLVED
Go to solution

Freeing space on / (root)

Hi friends
Which one could be the best way to know which folders or files are using more space on a path (in my case, root).

I just want to know this information specifically for this filesystem, because it is reaching its limit.

Thanks in advance for any suggestion!!!

Best regards

RQT

8 REPLIES 8
Patrick Wallek
Honored Contributor
Solution

Re: Freeing space on / (root)

The first thing I'd check is /dev/rmt/ and make sure there are no files there like om (instead of 0m) that are large.

To see what directories are taking up space do:

# cd /
# du -kx | sort +n

this will give you a list of directories in / (without crossing mountpoints) and sort them in size order.
Denver Osborn
Honored Contributor

Re: Freeing space on / (root)

Try:

du -kx /

Each directory under root will be in 1024-byte blocs.

-denver
Paul Sperry
Honored Contributor

Re: Freeing space on / (root)

Try

cd /
du -sk *
Uday_S_Ankolekar
Honored Contributor

Re: Freeing space on / (root)

du -sk * in / will give you the list of directories with occupied size. Most of the time it's /var that gets filled up.

Use find command to see which file(s) is taking lots of place in /var
EX:
find /var -size +100000c -exec ls -al {} \;

Increase or decrease the number of zeroes to look for the desired file size

-USA..
Good Luck..
Jose Mosquera
Honored Contributor

Re: Freeing space on / (root)

Hi,

This will be you useful:

du / -akx|sort -nr|more

Rgds.
James Odak
Valued Contributor

Re: Freeing space on / (root)

if your searcing root for large files

find / -xdev -size +2000 -depth -print -exec ls -la {} \;

raise or lower the value from 2000 as needed

the -xdev keeps the search within the root FS and will not scan /var /opt and such

Re: Freeing space on / (root)

Thank you very much folks!
All you, gave me really usefull information.

Best Regards

RQT
Bill Hassell
Honored Contributor

Re: Freeing space on / (root)

As mentioned, du will give you the directory usage. Once you locate large directories, look inside to find big files. To sort files by size, do this:

ll | sort -rnk5 | more -e

Note that / never grows except by mistake. The most common reason is mispelled device files (tpyically in /dev/rmt) and bad applications that store their files in /.


Bill Hassell, sysadmin