Example for set storage limit


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.



What backend storage do you use?
With btrfs backend storage i do the following:

  • sudo lxc config device add container_name root disk pool=default path=/
  • sudo lxc config device set container_name root size 25GB


thank you for the hint.

I use zfs as file system.

I used the second line without success and noticed on a couple of websites command line 1, but I am not sure what does it mean and why I need this ?

What does command line 1 do and what is the result ?

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.


Thank you very much for the hint