Skip site navigation (1)Skip section navigation (2)
Date:      25 Jul 2002 20:03:36 -0700
From:      karl agee <kdagee@attglobal.net>
To:        Jerry McAllister <jerrymc@clunix.cl.msu.edu>
Cc:        freebsd-questions <FreeBSD-Questions@FreeBSD.ORG>
Subject:   Re: Linking a directory to another filesystem
Message-ID:  <1027652619.499.6.camel@enterprise.workgroup>
In-Reply-To: <200207252250.g6PMorT15954@clunix.cl.msu.edu>
References:  <200207252250.g6PMorT15954@clunix.cl.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 2002-07-25 at 15:50, Jerry McAllister wrote:
> > 
> > sorta newbie question, I think, and not sure where to post it...so I put
> > it here.
> > 
> > system:  5.0-current, lots of hard disk space.
> > 
> > I am filling up / with stuff...so much so that the system is crashing
> > and rebooting(!) when I print.  Problem seems to be that /usr directory
> > is located on the / filesystem when I have a /usr filesystem that has
> > gobs of space but not much on it.
> > 
> > I want to move the /usr directory contents over and link the /usr
> > directory on the / filesystem to the /usr filesystem but not exactly
> > sure how to do it (after reading the docs) without messing things up. 
> > Not sure if I need to soft link or hard link...etc.  
> 
> I just posted three detailed ways of doing this yesterday.  It was 
> for the /var directory but it would be the same thing for /usr.
> You can look through the list archives for it.
> 
> Actually, we find that is is /usr/local that grows a lot so on
> our systems we just pull our /usr/local and put it somewhere else
> with a link, but your usage may be different I suppose.
> 
> Anyway, basically
>   - make yourself some space where there is lots of room to grow.
>   - It may mean adding a disk, partitioning it with fdisk and disklabel
>     and newfs-ing the partition[s].  I'll assume that is done.
>   - create a directory there, be it just a subdirectory or a 
>     whole partition.  Let's say you got it all made and mounted
>     as /newplace
>   - Move the contents of /usr to it probably using tar 
>     # cd /
>     # tar cf /newplace/usr.tar   /* Here I assume lots of space in newplace
>     # cd /newplace               /* Or else put the tar file some where else
>     # tar xf usr.tar
>     # mv tar new.usr
>   - rename the old /usr          /* just keep it handy in case of a skrewup
>     # cd /
>     # mv usr usr.old
>   - make a link
>     # ln -s /newplace/new.usr usr
> 
> Now you are ready to go.  You can go back and  rm -rf  the  /usr.old
> after you have checked out the new one and then goto /newplace and
> get rid of the tar file.
> 
> Probably it is best to do all this in single user.
> 
> It isn't necessary to call the new usr directory in /newplace anything
> other than just usr, but I like to do that to make it clear what I
> have done so I don't confuse myself on those groggy mornings.
> 
> ////jerry

Jerry:  

I'm confused.

Not by what you did but what I am trying to do. ;-)

My /usr directory is on my / partition (linux lingo).  But I want to
move it to my /usr partition (linux lingo again) where I have gobs of
space and only a little is being used.

I thought setting up the separate filesystems (partitions in linux
lingo) would put the directories there but huh.  

make sense?  Guess I dont know how I would make sure I move /usr
directory to the /usr filesystem (and properly soft link it)and not just
make a new /usr directory  on the /usr directory on the / filesystem... 
%-)

-karl who throughly confusted himself



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?1027652619.499.6.camel>