If files are hard links they will have the same inode, you can get this information from stat but you'll have to stat every file on the filesystem until you've found all the links. In your case, I would use the -k flag to bzip2 to keep it from deleting the input file then copy the .bz2 file to the original file then delete the .bz2 file.