Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Nov 2013 10:19:33 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Darrel <levitch@iglou.com>
Cc:        questions@freebsd.org
Subject:   Re: unlink a directory
Message-ID:  <20131128101933.6356eea4.freebsd@edvax.de>
In-Reply-To: <alpine.GSO.2.00.1311280402310.2785@shell1>
References:  <alpine.GSO.2.00.1311280402310.2785@shell1>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
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 <device>

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 <device>

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, ...



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20131128101933.6356eea4.freebsd>