I have ubuntu 21.10 installed. I confirmed that I am using cgroup v2 by running mount
, which shows cgrup2 on /sys/fs/cgroup type cgroup2
.
When I want to use cgcreate
from cgroup-tools
to create a new group for cpu
:
sudo cgcreate -g cpu:newgroup # or
sudo cgcreate -g all:newgroup
it fails with error:
cgcreate: libcgroup initialization failed: Cgroup is not mounted
I have several questions:
- Is this because
cgroup-tools
is for cgroup v1? - What should I use to create new cgroups for cgroup v2?
- How to create persistent cgroups (when booting) using config files for cgroup v2?
The current
cgroup-tools
(in Ubuntu 21.10 and earlier) is 0.41 which only works with CGroups v1 and is no longer supported. Jammy (22.04) will have the newcgroup-tools
version 2.0 that supports CGroups v2.