In the manual page of tar command, an option for following hard links is listed.-h, --dereference      follow symlinks; archive and dump the files they point to--hard-dereference      follow hard links; archive and dump the files they refer toHow does tar know that a file is a hard link? How does it follow it?What if I don't choose this option? How does it not hard-dereference?
Dereferencing hard links
tar;hard link
By default, if you tell tar to archive a file with hard links, and more than one such link is included among the files to be archived, it archives the file only once, and records the second (and any additional names) as hard links.  This means that when you extract that archive, the hard links will be restored.If you use the --hard-dereference option, then tar does not preserve hard links.  Instead, it treats them as independent files that just happen to have the same contents and metadata.  When you extract the archive, the files will be independent.Note:  It recognizes hard links by first checking the link count of the file.  It records the device number and inode of each file with more than one link, and uses that to detect when the same file is being archived again.  (When you use --hard-dereference, it does not do this.)