I need to create img container for archive some directories and files.
For that I need to create it with dd. It's no problem but I can't create it 'cause I don't know real size of the some directories and files. As I understand img container don't support dynamic size.
As we can see at image of link are two positions Size and Size on disk.As I understand I need Size on disk, but there is no Python example with Size on disk.
If I will use Size, maybe I will get an error Not enough space when use container.
Of course I can get real Size on disk with helping Block size of my partition and Size and calculate Size on disk by hand (like here) but I think it may be easier.
Q: How do get real Size on disk with Python?