Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

hard link su directory

0 views
Skip to first unread message

Antonio Macchi

unread,
Nov 11, 2009, 4:50:49 AM11/11/09
to
perche' non si puo' fare un hard link ad una directory?

eppure anche le directory sembrano avere un inode... e pure degli hard
link ( . e .. )

Davide Bianchi

unread,
Nov 11, 2009, 5:04:24 AM11/11/09
to

http://linuxgazette.net/issue93/tag/2.html

USER'S (including 'root') are forbidden to create additional hard
links because this would make fsck much more difficult to implement
and it might allow one to create hard link loops, and dangling sub
trees.

Basically the directory linkages are maintained by the filesystem
to glue the whole tree together, to ensure that it is truly an acyclic
tree structure with a single root.

In other words it's a policy enforced by the kernel. Some other
UNIX systems have allowed root to create hardlinked directories; and
it could be done with a disk editor like LDE under Linux (though I'd
expect fsck to complain the next time it was run --- and if you did
something degenerate you might cause some interesting problems ---
possibly even cause the kernel to treat the fs as corrupt and invoke
it's handler (remount,ro, panic, or continue) and possibly even cause
some kernel threads to run amok or panic the system.

Davide

Antonio Macchi

unread,
Nov 11, 2009, 5:10:16 AM11/11/09
to
> In other words it's a policy enforced by the kernel. Some other
> UNIX systems have allowed root to create hardlinked directories; and
> it could be done with a disk editor like LDE under Linux (though I'd
> expect fsck to complain the next time it was run --- and if you did
> something degenerate you might cause some interesting problems ---


"interesting problems" :)


> possibly even cause the kernel to treat the fs as corrupt and invoke
> it's handler (remount,ro, panic, or continue) and possibly even cause
> some kernel threads to run amok or panic the system.
>
> Davide


un'altro piccolo pezzetto del grande puzzle...

grazie 1000

0 new messages