0

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.

  • 1
    Please edit question with the filesystem you use (ext4? btrfs? something else?) Also, please check with ls -l (which shows the number of hardlinks in the 2nd column) that every file in the directory you are removing has other hardlinks. Also, try removing the files one by one, and see at which points df claims more space. As you say, on ext-filesystems, removing hardlinked files shouldn't free up significant space. – dirkt Sep 22 '18 at 6:00
  • 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. – RAJSEKHAR Sep 26 '18 at 12:30
1

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.