We are doing incremental backup with use of hard links the initial size was 10 TB and we added 1 TB weekly .

backup1: 10TB
week2: 1TB
week3: 1TB

du -hs week2 reports 11 TB; it is ok as inode are same and du considers it to create disk usage find with it ..

but when we do df to /backup (40TB) volume it is reporting backup1 (10T)+week2(11T)+week3(12T) = 33 TB --

this is bit critical as df suspects that volume is growing fast (which is not since it only adds 1TB per week) and we are getting alarms about space ...

Is there any way we can tell df not to count hard links ? or any other command to find the exact free space in volume?


The output from df is correct. Apparently you are not getting any reduction in the size of backups with the tool you are using.

In your investigation, it may help to know that du will show the effect of hardlinks. Run it on the directories together, in order, e.g. du -shc backup1 week2 week3. It will show reduced size for the later directories if they contain hardlinks to previous ones, and the last line will show a total. See for example https://stackoverflow.com/questions/19951883/du-counting-hardlinks-towards-filesize

This link also points out, if you want to examine the difference that accounting for hardlinks makes, compare the above with du -l .... This option is described as "count sizes many times if hard linked".

  • Than If hardlinks also take same extra space like original files.. than what is the benefit of them ? .. if there are 4 backups than what i noticed that total df shows 4X space ... where as it should report 1x since they all point to same inodes.. – Zeeshan Aug 5 '17 at 9:44
  • @Zeeshan please provide evidence that the backups are hardlinked :) – sourcejedi Aug 5 '17 at 10:19
  • I used this rsnapshot.org/faq.html – Zeeshan Aug 12 '17 at 11:44
  • @Zeeshan evidence please. use ls -l or stat on unchanged file in both snapshots to show link count > 1 – sourcejedi Aug 12 '17 at 11:53

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.