You can distinguish a file with hard link(s) to it from a non-hard-linked file with the "link count". I see two ways of getting this from the command line:
% stat original
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: 804h/2052d Inode: 932815 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 500/ bediger) Gid: ( 1000/ bediger)
Access: 2012-07-13 22:13:52.317101530 -0600
Modify: 2012-07-13 22:13:52.317101530 -0600
Change: 2012-07-13 22:14:08.050894536 -0600
1010 % ls -li
932815 -rw-r--r-- 2 bediger bediger 0 Jul 13 22:13 original
932815 -rw-r--r-- 2 bediger bediger 0 Jul 13 22:13 secondary
That lonely '2' before "bediger" is the link count. Note that both filenames have the same inode number, 932815.
I'm certain that both of these commands get the link count from the st_nlink field of struct stat, which gets filled in by a
stat() system call.
As near as I can tell, running
--hard-dereference means that instead of getting a single file with two distinct filenames (as in example above), you get two files, each with a single filename.
tar probably checks the link count on each file, and by default when extracting, it creates a hard link on the second filename it has for the hard-linked file data. When called with
--hard-dereference on archive creation, it appears to create an entirely new file for the second file name when the extraction invocation of