l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2003 Sep 23 10:50

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Resizing Root Partition
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Resizing Root Partition

On Tue, Sep 23, 2003 at 10:14:06AM -0700, Mark K. Kim wrote:
> Your root is taking up too much space.  My primary system uses only 125MB
> in root, even though I don't have a separate /tmp.  I'd look into why it's
> so big.
> Some ideas:
>    1. Unmount everything but root (easier yet, run in single-user
>       mode).  See if you got anything in /usr, /tmp, and /var.  They
>       should be empty.

I agree with /tmp and /usr, but whenever I have had a seperate /var, I
always have a small directory structure under it.  Some programs, like
vi for example, will not run w/o a /var/tmp.  I think I put a /var/tmp,
/var/spool/, and /var/log in there.  

>    2. If you got /opt or /pkg, move them to /usr and symlink.
>    3. Your root home (probably /root or /) should stay pretty
>       small.  Move things you don't need out of it
>       (for example, downloaded files.)

It is bad to have root's homedirectory on /.  What I do is move it to
/home/root and symlink /root to it.  I have never encountered an issue
where I wanted a seperate /root on linux, and those systems I have
encountered issues with, root's homedir is /

>    4. Unmount everything but root, and type:
>          cd /
>          du -sH *
>       which should tell you how much each directory is using up
>       how much space.  CD into the big directories and type
>       `du -sH *` again, then again, then again until you find
>       the culprits.  Remove things like coredumps and such.

There's a slightly better(IMHO) way of doing this: 

find / -xdev -type f -print | xargs du -sk | sort -rn | head -25 

This will give you a list of files that are taking up the most
diskspace.  If you switch the type flag to d, it will give you the
directories.  I prefer doing it this way as you are comparing apples to
apples, which allows you to use sort -rn to reverse sort the thing and
come up with something that makes some sense.  the H option is great for
df, but I don't find it as useful in du...  One other thing to note is
that -xdev means do not cross into other filesystems, which allows you
to run this on a running node.  

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.