Creating hardlinks for directories.

Charles Curley charlescurley at charlescurley.com
Sun Jan 15 15:58:12 UTC 2006


On Sun, Jan 15, 2006 at 04:40:20PM +0530, Vikram Goyal wrote:
> Hi,
> 
> I wanted to create hardlinks for directories on the same file system.
> I know it's not allowed. But the man page for ln says one may. Now I
> want to know how may one switch it on.
> 
> Also what could be the pitfalls.

Don't. Use an alternative, such as symlinks.

Should you manage to change the normal directory tree stucture into a
circular structure, you will break a great many programs that depend
on the file system being a tree. For example, the nightly slocate cron
job will take forever, or until it fills up the hard drive. Backup
tools such as tar will be similarly broken.

And you won't always know when you create a circular link.

Also, because hard links may not cross file system boundaries,
programs that use them may not be portable.

I learned a lot about the evils of hard linking directories while
writing backup software. Believe me, you don't want to learn about
those evils. Joseph Conrad could have written that story.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060115/44ba76b5/attachment-0001.sig>


More information about the fedora-list mailing list