Score:0

CGroup not mounted on Fedora 34

uz flag

I have freshly provisioned Linode instance with Fedora 34. The only thing I have installed on it is libcgroup. cgconfig service is starting properly and there are no errors but the subsystem is not working.

I am getting the following error when I execute lscgroup command.

[root@localhost ~]# sudo lscgroup
cgroups can't be listed: Cgroup is not mounted

Further on the topic, when I execute lssubsys -am command I get the following

cpu
cpuacct
blkio
memory
devices
freezer
net_cls
perf_event
net_prio
hugetlb
pids
misc

can anyone please help me solve this problem?

Score:0
uz flag

Answering my own question. After banging my head for 4 days I have found a solution. The actual issue is Fedora specifically and other Linux systems generally have moved from CGroup v1 to v2 by default as a unified subsystem. So was in my case, I was trying to set up CGroup V1 controllers whereas my Fedora 34 OS was running CGroup V2, which was causing my CGConfig service to crash upon restart. The solution was to move to CGroup V1 and to do this run the following command

Add systemd.unified_cgroup_hierarchy=0 to the default GRUB config with sed.

sudo sed -i '/^GRUB_CMDLINE_LINUX/ s/"$/ systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub

Now rebuild your GRUB config.

If you’re using BIOS boot then it’s this.

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

If you’re running EFI, then it’s this.

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Now reboot and make sure Docker can start!

The original solution was posted on this blog.

https://blog.christophersmart.com/2019/12/15/enabling-docker-in-fedora-31-by-reverting-to-cgroups-v1/

Michael Hampton avatar
cz flag
This also means _you_ should be moving to cgroup v2. It's supported in docker 20.10 and later.
Albert Lilly avatar
uz flag
I am pretty green on cgroup v2 and the application I was trying to set up uses v1. So I had only two options either to modify the application or to move back to v1. I know in the future v1 would eventually be deprecated but for now, this will give me enough time to learn v2 and make changes in the application to support it.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.