Hi Derec, > It appears that tar doesn't always recognize (and treat as hard links) files > that are the same file, but appear in two different directories from bind > mounts. > > $ sudo mount -o bind /tmp/foo/bar /tmp/foo/baz > $ echo "test data" >/tmp/foo/bar/bleh > $ stat --printf "%d %i %n\n" /tmp/foo/bar/bleh /tmp/foo/baz/bleh > 51 97105 /tmp/foo/bar/bleh > 51 97105 /tmp/foo/baz/bleh
Tar uses link count to decide whether a file might be a hard link to another file. In this test case, link count of bleh is 1, so it skips hardlink detection phase. To force hardlink detection, use the -h (--dereference) option: tar -hcf /tmp/testing.tar /tmp/foo Regards, Sergey