2

I have a tinker board 2s (like raspberry pi) running debian on kernel 4.4.194.

I enabled cgroups v2 by adding systemd.unified_cgroup_hierarchy=1 into the /boot/cmdline.txt file as supposed to.

the result of ls /sys/fs/cgroup/ is:

cgroup.controllers cgroup.procs cgroup.subtree_control init.scope system.slice user.slice which is correct it seems.

However, according to this guide, now I need to add cpu and chipset into the cgroup.subtree_control as well, but this is where i am stuck.

echo '+cpu' >> /sys/fs/cgroup/cgroup.subtree_control
echo '+cpuset' >> /sys/fs/cgroup/cgroup.subtree_control

these results in permission denied errors... even when i sudo echo it, it results in the same thing.

ls -l for /sys/fs/cgroup shows:

-r--r--r--  1 root root 0 Dec  2 06:52 cgroup.controllers
-rw-r--r--  1 root root 0 Dec  2 06:29 cgroup.procs
-rw-r--r--  1 root root 0 Dec  2 06:53 cgroup.subtree_control
drwxr-xr-x  2 root root 0 Dec  2 06:19 init.scope
drwxr-xr-x 53 root root 0 Dec  2 06:33 system.slice
drwxr-xr-x  4 root root 0 Dec  2 06:19 user.slice

I'm at at loss as to who to add cpu and chipset into cgroup v2...

My purpose is to install kubernetes and connect the boards up as a cluster. but kubeadm failed saying that CPU and CPUSET is not found. That problem then led me to cgroups v2.

2
  • 1
    Regarding sudo echo, I think the problem you're experiencing is related to stackoverflow.com/questions/36853564/… Try those solutions out, or just sudo -i and then run the echo from the root shell.
    – bgfvdu3w
    Commented Dec 18, 2021 at 18:24
  • @bgfvdu3w , I had the similar problem and I had changed the file permissions to solve it (sudo chmod o=rw <filename>) . But solution you linked worked without touching any permission(i.e. sudo bash -c ' echo "xxx" > [ file] ' ). Thanks.
    – user458762
    Commented Mar 17, 2022 at 15:47

1 Answer 1

0

Although @bgfvdu3w stated the answer and the solution, one alternative is that: open up terminal window and simply write :

sudo -s<<START
echo '+cpu' >> /sys/fs/cgroup/cgroup.subtree_control
echo '+cpuset' >> /sys/fs/cgroup/cgroup.subtree_control
START

After writing an opening tag( first START word), terminal waits for new inputs for command will be performed under superuser's priviliges and puts ">" char at the beginin of terminal prompt line. When you finished writing commands and enter after end tag (second START word) terminal returns to normal prompt status and applies all commands between with superuser's priviliges.

When errors are due to permission while using sudo, I always use this option. If error continues, I will check permissions.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .