**** Hard link to a directory would create a loop in the filesystem graph and that would really confuse the programs
relying on the graph traversal
(e.g. fsck).
**** Maybe you can use the mount command with --bind para to hard link a directory.
-----------
Hard Link
http://c2.com/cgi/wiki?HardLink
In a traditional UNIX filesystem, a directory is just a file that contains an association list. The entries in that
list map names, which are strings, to inode numbers, which are unique file identifiers. An inode number is
essentially an on-disk pointer; the file object can be efficiently located from this number. No two objects have the
same inode number, and no object has more than one inode number.
The term "hard link" is essentially just a synonym for "directory entry". When an object is created for the first
time, a directory entry is created for it as well. This is in fact a hard link, but most people usually associate
"hard linking" to be the creation of additional directory entries for an existing object. But the original entry is
not special in any way; all the links are equal in the sense that there is no way to tell which was the original.
Directories can contain directories, of course, and this is done by hard links as well. When a subdirectory is
created, a directory entry is created in the parent which associates the name of the subdirectory with the newly
created inode. Also, the new subdirectory object is automatically stuffed with two entries which associate the names
. and .. (dot and dotdot) with the new directory, and the parent, respectively. Therefore, the creation of a
relying on the graph traversal
(e.g. fsck).
**** Maybe you can use the mount command with --bind para to hard link a directory.
-----------
Hard Link
http://c2.com/cgi/wiki?HardLink
In a traditional UNIX filesystem, a directory is just a file that contains an association list. The entries in that
list map names, which are strings, to inode numbers, which are unique file identifiers. An inode number is
essentially an on-disk pointer; the file object can be efficiently located from this number. No two objects have the
same inode number, and no object has more than one inode number.
The term "hard link" is essentially just a synonym for "directory entry". When an object is created for the first
time, a directory entry is created for it as well. This is in fact a hard link, but most people usually associate
"hard linking" to be the creation of additional directory entries for an existing object. But the original entry is
not special in any way; all the links are equal in the sense that there is no way to tell which was the original.
Directories can contain directories, of course, and this is done by hard links as well. When a subdirectory is
created, a directory entry is created in the parent which associates the name of the subdirectory with the newly
created inode. Also, the new subdirectory object is automatically stuffed with two entries which associate the names
. and .. (dot and dotdot) with the new directory, and the parent, respectively. Therefore, the creation of a