Quote:
Originally Posted by BetterRed
Normal behaviour is that deleting a 'hardlink' (i-node) doesn't delete the 'file' (datastream) unless its the last i-node to the datastream in question.
I'm not sure about e..z's suggested usage of hardlinks and rsynch, maybe he can tell us if there are circumstances that the scripts do delete all the hard links for a given datastream.
BR
|
Hardlinks point to inodes. The inode is the datastream.
The only ways to delete all hardlinks that point to an inode (at least, all the ways I know of) are to either use something like:
"ls -li" to find the inode and "find -inum $inode | xargs rm" to remove it
or the simpler
Code:
find -samefile $file | xargs rm
Either way, yeah. You have to be fairly determined to delete all hardlinks to an inode, because by definition they exist to preserve the datastream unless you specifically delete all locations. If it was acceptable to delete it in one location and break all the other links, we would use soft/symlinks.
Quote:
Originally Posted by Inferno
Am I mistaken that if I delete the file the link points to it is gone? In the backup as well? or am I missing something?
|
Hardlinks ensure that if you delete the file, it is still in the other location. Additionally, we do not
ever hardlink a backup to your main copy. If we did, then any edits you made would change the inode which is hardlinked from the backup too. That would be bad, since the backup is supposed to show what it used to look like, so... we do not hardlink to the main files, only between the backups themselves.