Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Dec 2001 22:12:05 -0500 (EST)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        gsfgf@hotmail.com (Jeff Jeter)
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: New Disk on IDE card
Message-ID:  <200112220312.fBM3C5Y24800@clunix.cl.msu.edu>
In-Reply-To: <OE48DVniSnRMWuLn5U9000062f3@hotmail.com> from "Jeff Jeter" at Dec 21, 2001 09:39:03 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> My /usr filesystem is low so i was wondering if i can make a partition on
> the new disk, mount it as /usr and have more space left on the /usr fs.

Probably you want to make a very large partition on the new drive - 
maybe the whole drive to make the thinking easier.  Then go in to
the current /usr partition and do a 'du -sk *' to find out which
directories are taking up the most space.  A good guess will be
the ./src and maybe ./local directories (and possibly ./ports 
and ./games (if you have installed a bunch of them) are pretty big.   
Then go in to the new drive large partition and make directories 
there for each you want to move, move the files and then make 
softlinks in /usr to the new directories.

For directory names we use a convention of calling the new directories 
  basedir.dirname so following that, in the new large file system I would 
make a directory called usr.local (or maybe just u.loc or whatever actually
I just made a u.local in the most recent one I did) 

So, lets say you made a nice new giant partition with plenty of space
to grow (gazillions of GigaBytes) and mounted it as /newbigfs

Then you would do something like the following (as root):
    cd /newbigfs
    mkdir u.local
    cd /usr/local
    tar cvf /newbigfs/ulocal.tar *
    cd /newbigfs/u.local
    tar xvf ../ulocal.tar
    cd /usr
    mv local local.old        (just in case you screwed up)
    ln -s /newbigfs/ulocal local
Then check it out - make sure doing a cd /usr/local gets you in to
the right place, and the files look good, check permissions on dirs.
Finally do:
    cd /usr
    rm -r local.old

Do something similar for /usr/src and /usr/ports.

Voila, you now have lots of space in the /usr file system
I would avoid doing that for directories that the system 
depends on a lot to just stay alive and you to get around
in it.  Things such as /usr/bin and /usr/sbin should probably
stay where they are.   This is in case the other disk doesn't
mount or you are planing in single user, etc.

Other candidates for moving to your new giant file system
might be /var/spool and /var/log if your /var is full (or
if it is really in root).   just make a /newbigfs/var.log
directory.  Move stuff to it and go into /var, get the old stuff
out of the way and make the softlink.

////jerry

> 
> Jeff Jeter
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112220312.fBM3C5Y24800>