I would like to set a limit for the disk space after I created a container (Ubuntu 20.04LTS). I didn’t use (because I don’t have the knowledge yet) any specific profile.
Could someone please provide me with an example how I could set this limit, because I tried 1000 things I found in the internet but nothing worked.
Hi Marc,
If you want to set a limit for a container you can give that command can solve the issue, i suppose. lxc config device override <container_name> root size=5GB, for example.
You can check it out with the pleasant command lxc config show <container_name> --expanded.
@cemzafer Thanks for your answer, this command worked for me but do you know why when I run the df -H inside of my container I got the previous size (203G):
Filesystem Size Used Avail Use% Mounted on
/dev/disk/by-uuid/85718809-e3c0-43cf-b899-ba375160df8e 215G 11G 203G 5% /
This is due to how BTRFS works sadly, it doesn’t expose quotas through filesystem (unlike ZFS for example). The quota is applied but not visible using command-line utilities such as df.