From owner-freebsd-questions Fri May 19 20:30:34 2000 Delivered-To: freebsd-questions@freebsd.org Received: from sub48-230.member.dsl-only.net (sub48-230.member.dsl-only.net [216.36.48.230]) by hub.freebsd.org (Postfix) with ESMTP id AAD5337B72F for ; Fri, 19 May 2000 20:30:31 -0700 (PDT) (envelope-from eito@sub48-230.member.dsl-only.net) Received: (from eito@localhost) by sub48-230.member.dsl-only.net (8.9.3/8.9.3) id UAA46511; Fri, 19 May 2000 20:30:23 -0700 (PDT) (envelope-from eito) Date: Fri, 19 May 2000 20:30:23 -0700 From: eito To: freebsd-questions@FreeBSD.ORG Cc: Jack Verdirame Subject: Re: symbolic links and /var Message-ID: <20000519203023.B46192@dsl-only.net> Reply-To: eito@cs.pdx.edu References: <00051915254902.00333@sqlczar.netravision.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <00051915254902.00333@sqlczar.netravision.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, May 19, 2000 at 03:17:02PM -0700, Jack Verdirame wrote: > I was suppose to move the /tmp and /var to the /usr volume and create a > symbolic link between them. This worked for the tmp directory. What I was > doing for the /var directory is the following: > > mkdir /usr/var > cd /var > tar cf - . | (cd /usr/var; tar xf - ) > cd / > rm -rf /var > ln -s /usr/var > > I go this from the freeBSD book written by Greg Lehey - Excellent Book. > > Anyway when I do the rm -rf /var it returns a device busy and will not > remove the directory. I have gone into single user mode and tried this > but the rm command returns the same result. I am logged in as root, also. The error was because some programs were still accessing files in /var. You can run 'lsof' (this is in /usr/ports) to see which files are opened by what programs. > I did notice there is a var -> /usr/var symbolic link in the var directory. > I have tried to remove this but I must be doing something wrong because it > won't remove. > > I do a ln -f /usr/var /var but is say it is not a directory. The symbolic link, var, was created by the last command (ls -s /usr/var). I don't know how you tried to remove this link. (rm should do the job.) If you tried to remove it (and recrete a link) with 'ln -f /usr/var /var', the reason you could not remove the link was, as the error message said, because the source was a directory. You cannot create hard link of a directory. So, you should use '-s' option to create a symbolic link. Please check out ln man page for more details. Regards, :eito To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message