Most Linux and Unix file systems don't allow hard links to directories (except for the . and .. entries that mkdir creates itself).
The reasons are are pretty obvious: you could really confuse programs like ls (ls -R), find and of course fsck if you created links that recursed back to themselves. If there was a compelling reason to allow directory hard links, you'd need to rewrite any program that wants to walk a file system tree to be aware of the possible problems..
So instead we have symlinks. You've probably used them for things like mount --bind /foo /home/fred/foo
Fred can have full write permissions on /foo if he needs it, but he will not be able to remove /home/fred/foo. Not even root can:
# rm -rf /home/fred/foo
rm: cannot remove directory '/home/fred/foo': Device or resource busy
Some related links you might find interesting:
http://linuxgazette.net/issue93/tag/2.html
*Originally published at Del.icio.us") | Yahoo! My Web
A.P. Lawrence provides SCO Unix and Linux consulting services http://www.pcunix.com
mount --bind
3 min read
2 views
Comments (0)
Please sign in to leave a comment.





No comments yet. Be the first to comment!