Hard links

Nick Duffek nick@duffek.com
Mon, 11 Mar 2002 22:16:01 -0500 (EST)

On 10-Mar-2002, Ben Escoto wrote:

>So if hard links are to be supported, I think that any hardlinked
>file should only be snapshotted, and never diffed.

I'll go out on a limb and guess that in most cases, hard links are
preserved when a file is changed.

Example 1: When I upgrade gzip, /bin/gzip has 4 hard links both before and
after the upgrade.

Example 2: If I edit a hard-linked file in Emacs or vim, the links aren't
modified.  I think that that's a property of most UNIX editors.

If my guess is true, then snapshotting hard-linked files would waste space
in most cases.

>When preserving hardlinks, just write a big data file each backup which
>lists all the files which are hardlinks and what they are hardlinked to.

I think that's a great idea.

I'm not sure whether this is part of your plan, but it "would be nice" if
the mirror had hard links intact.  I don't think that that's useful for
files in /rdiff-backup-data, though.

>Would hardlink support still be useful given these limitations?

It'd definitely be useful to me.


P.S.  On my home Linux system, only 276M out of 25G of data is in
hard-linked files.  I don't know how that's relevant, but since I took the
trouble to check, I thought I'd share the results. :-)