On 2020-05-09 12:11, Steven Davies wrote:
For curiosity I'm trying to write a tool which will show me the size of data extents belonging to which files in a snapshot are exclusive to that snapshot as a way to show how much space would be freed if the snapshot were to be deleted, and which files in the snapshot are taking up the most space. I'm working with Hans van Kranenburg's python-btrfs python library but my knowledge of the filesystem structures isn't good enough to allow me to figure out which bits of data I need to be able to achieve this. I'd be grateful if anyone could help me along with this.
Apologies for the spam, I've got most of it figured out now. The only thing remaining is to remove the double-counting of extents referenced by multiple files in the same subvolume. The code is here: https://github.com/daviessm/btrfs-snapshots-diff/blob/master/btrfs-subvol-size.py
-- Steven Davies
