From owner-freebsd-questions Thu Jul 25 15:51:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B312F37B400 for ; Thu, 25 Jul 2002 15:51:06 -0700 (PDT) Received: from clunix.cl.msu.edu (clunix.cl.msu.edu [35.9.2.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id C844E43EEC for ; Thu, 25 Jul 2002 15:51:04 -0700 (PDT) (envelope-from jerrymc@clunix.cl.msu.edu) Received: (from jerrymc@localhost) by clunix.cl.msu.edu (8.11.6+Sun/8.11.6) id g6PMorT15954; Thu, 25 Jul 2002 18:50:53 -0400 (EDT) From: Jerry McAllister Message-Id: <200207252250.g6PMorT15954@clunix.cl.msu.edu> Subject: Re: Linking a directory to another filesystem To: kdagee@attglobal.net (karl agee) Date: Thu, 25 Jul 2002 18:50:53 -0400 (EDT) Cc: FreeBSD-Questions@FreeBSD.ORG (freebsd-questions) In-Reply-To: <1027634062.758.4.camel@enterprise.workgroup> from "karl agee" at Jul 25, 2002 02:54:24 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > 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