I have a source directory with files in it. I then made a exact mirror of all the directories using mkdir recursively. However the file contents are hard links in all the mirrored copies.
Essentially as I understand it, each hard link points to a source or original file. If the source is removed do all the hard links break or is this only the case with soft links?
Hard links are pointers to contents and a reference counting mechanism is used to detemrine when file data is removed, this I understand. So if I create a file normally it's data is already stored as a hard link and adding additional hard links just increments the counter?
Basically, if I have several files which hard link to a source, either of those edited files will be reflected through any of the other 'aliases' so to speak.
How can I tell if the file I'm editing is a hardlink or a physical copy of the original -- that is if modified it creates a branch as opposed to updating multiple copies simulatneously???
Cheers