Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2002 18:50:53 -0400 (EDT)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        kdagee@attglobal.net (karl agee)
Cc:        FreeBSD-Questions@FreeBSD.ORG (freebsd-questions)
Subject:   Re: Linking a directory to another filesystem
Message-ID:  <200207252250.g6PMorT15954@clunix.cl.msu.edu>
In-Reply-To: <1027634062.758.4.camel@enterprise.workgroup> from "karl agee" at Jul 25, 2002 02:54:24 PM

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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
    
> 
> thanks, karl
> 
> 
> 
> 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?200207252250.g6PMorT15954>