Hard links

Ben Escoto bescoto@stanford.edu
Mon, 11 Mar 2002 23:38:14 -0800


--==_Exmh_996440250P
Content-Type: text/plain; charset=us-ascii

>>>>> "ND" == Nick Duffek <nick@duffek.com>
>>>>> wrote the following on Mon, 11 Mar 2002 22:16:01 -0500 (EST)

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

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

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

  ND> If my guess is true, then snapshotting hard-linked files would
  ND> waste space in most cases.
    ...
  ND> I'm not sure whether this is part of your plan, but it "would be
  ND> nice" if the mirror had hard links intact.  I don't think that
  ND> that's useful for files in /rdiff-backup-data, though.

I meant the mirror to have hard links intact, and also for the
snapshots on in the increments directory to be hardlinked.  Just to
clarify: if you upgraded /bin/gzip, then afterwards rdiff-backup would
have two relevant files:  one in the mirror directory, present in 4
places, and one snapshot in the increments directory, also present in
4 places.

    If /bin/gzip were diffed, then there would be 4 diffs in the
increments directory instead of one snapshot.  Which of these would
use more space depends on the specifics of how /bin/gzip was changed.
So it's not clear that the snapshotting would waste space, even if
they normally change at once.

    Why don't you think it would be useful to hardlink (snapshots) in
the rdiff-backup-data dir?

  >> Would hardlink support still be useful given these limitations?

  ND> It'd definitely be useful to me.

  ND> Nick

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

The results are interesting.  But this seems to contradict the earlier
remark - why would it be useful if only 1% of your files are
hardlinked?


--
Ben Escoto

--==_Exmh_996440250P
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Exmh version 2.5 01/15/2001

iD8DBQE8jbBl+owuOvknOnURAmovAJ9RvNlFUZAUGIHzH4cGBZ4lATgVzwCeMXOs
fM0Ovuu7L4UJ7cqilgFeMp8=
=6y6J
-----END PGP SIGNATURE-----

--==_Exmh_996440250P--