The question is not trivial. BTRFS is COW file system and one object stored on hard disk can be referenced by many files.
I use BTRFS snapshots as a part of a backup solution on my production server. This way I have space-efficient, browsable history of a given subvolume (I use a modification of the SnapBtr).
I have several independent btrfs subvolumes for different purposes and a backup scheme for each one. When the free space is running out, I can get the most unneeded backup snapshot from each backup pool based on the smart logarithmic-time-cost algorithm of SnapBtr
.
I need a way to weight the amount of data that will be freed after I remove each backup with age of the old snapshot and importance of its backup pool. I am missing the former information.
I understand that the process of calculation of the free space on the BTRFS is neither trivial nor quick. I need something that would simulate the subvolume's deletion to get the size of the would-be freed space.
Can anyone help me? Should I post this message to the [email protected]
?