From owner-freebsd-questions@FreeBSD.ORG Thu Nov 28 10:19:21 2013 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F27E7A47 for ; Thu, 28 Nov 2013 10:19:21 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5FE21363 for ; Thu, 28 Nov 2013 10:19:21 +0000 (UTC) Received: from r56.edvax.de (port-92-195-106-241.dynamic.qsc.de [92.195.106.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 9A002146C0; Thu, 28 Nov 2013 10:19:48 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id rAS9JXbg002143; Thu, 28 Nov 2013 10:19:34 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Thu, 28 Nov 2013 10:19:33 +0100 From: Polytropon To: Darrel Subject: Re: unlink a directory Message-Id: <20131128101933.6356eea4.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2013 10:19:22 -0000 On Thu, 28 Nov 2013 04:04:47 -0500 (EST), Darrel wrote: > I can not recall how to unlink a directory. Installed a FreeBSD10 system > from memory and when making the kernel link went to /root/kernels and > linked rather than /usr/src/sys/amd64. > > Now I have this: > > (120) @ 4:01:40> ls -L conf > conf > (121) @ 4:01:43> ls -P conf > conf > (122) @ 4:01:56> ll conf > lrwxr-xr-x 1 root wheel 24B Nov 24 22:57 conf@ -> > /usr/src/sys/amd64/conf/ > (123) @ 4:02:09> pwd > /usr/src/sys/amd64 > (124) @ 4:04:22> cd conf > conf: Too many levels of symbolic links. If I understand this correctly, you have: /usr/src/sys/amd64/conf -> /usr/src/sys/amd64/conf/ So /usr/src/sys/amd64> cd conf will result in an attempt to cd to /usr/src/sys/amd64/(conf=/usr/src/sys/amd64/)(conf=/usr/src/sys/amd64/)... This obviously looks wrong. :-) Probably you should try to remove the conf@ symlink (note: just a symbolic link, not a "real" directory!) by invoking /usr/src/sys/amd64> rm conf or /usr/src/sys/amd64> unlink conf With "man unlink" you'll see that the rm and unlink commands can easily remove a symbolik link. :-) If this _fails_, you can try the following, which is a little bit dangerous and you should know what you're doing: Use a live system or single user mode (/usr partition _not_ mounted), and call # fdsb Then in this program, navigate to /usr/src/sys/amd64 (or to /src/sys/amd64 if /usr is on its own parition), for example by cd /src/sys/amd64 and then use the del conf command. When the change has been writte to the file system, perform a file system check # fsck Then you should be able to mount it again. Note again: This is an extremely dirty method! See "man fsdb" for details. But I assume you won't have to do this. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...