Know the used storage of each single container

I have about 50 containers on one btrfs storage pool (lxd with snap and default.img)

How can I know the used storage of each single container?

The lxc info <instance> command will show root disk usage.
Keep in mind on BTRFS LXD uses snapshots of the source image so it may be smaller than you are expecting.

Thanks for the reply.

This solution returns a somewhat “wrong” or rather not real parameter.

I can get the correct parameter with the following command executed inside the container:

  • du -hs -m --exclude=/proc --exclude=/sys --exclude=/dev /

However, this method uses a lot of resources, and if we wanted to calculate the amount of storage used every “x” minutes, I would have an unjustified consumption of the entire server on 50 containers.

Do you have any recommendations?