[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in "ln -d"

From: Bob Proulx
Subject: Re: Bug in "ln -d"
Date: Fri, 22 Feb 2002 22:56:53 -0700

> There seems to be a problem with making a hard link to a directory, the man 
> page says that it should be possible, but it's not.

That depends upon the underlying filesystem.  For example, on HP-UX on
a HFS filesystem you can but on a vxfs filesystem you can't.  Most
modern systems are vxfs.

> When I try with "ln -d /old /new" I get:-
> "ln: creating hard link `/new' to `/old': Operation not permitted"
> This is as root, and regardless of where in the filesytem the target and 
> link are.

If the underlying operating system filesystem permits then the ln -d
command will do it.  But if not, as in your case with the error
message, "Operation not permitted" then it can't, even as root.  ln is
an application program and can't do more than the kernel lets it do.

Note that even if you create two directories linked together you might
find it difficult to remove them later.  For example, HP-UX provides
two commands for doing what you want (which are generally considered
dangerous) called /sbin/link and /sbin/unlink.  The GNU ln -d does the
equivalent of the hpux /sbin/link but I don't know of any equivalent
to the /sbin/unlink and you would be left with no way to remove those

You would probably find more expertise on this topic on one of the
kernel groups.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]