I am really confused on how to build an understanding around hardlinks. I work with a DB hosted on Linux. The Db in order to take backups creates hardlinks to data files in a different directory. Hardlinks as per the definition will not take up space on disk as they point to an existing inode of the file. But when removing files to clear up space on disk,it is normally recommended to delete the backups first. And this even works as after removing the backup (directory with hardlinks) directory,the df-h does show considerable amount of space is reclaimed. Please do help on how to visualize df du hardlinks, space occupied by hardlinks and how deletion of a link to an inode appears to reduce space on disk as per the df-h command.
Thank you so much.i found the answer. The database keeps merging original database files into New files and eventually removes the original db files.hence the hardlinks to old original files do start claiming space. A deletion of backups clears up all those old backups (hardlinks earlier created to old data files which are now merged and replaced), hence reclaims space. Find details in the below link: The DB in question is Apache Cassandra which runs compaction time and again to merge data files and demands backup files to be manually removed https://www.google.co.in/amp/s/www.imanisdata.com/limitations-snapshots-cassandra-backup/amp/