Enabling Cgroup v2 on RHEL 8 / Rocky Linux 8 (Versions 8.6 to 8.10)

Steps to enable cgroup v2 on RHEL 8 and Rocky Linux 8, which use cgroup v1 by default.

Default Status: RHEL 8 and Rocky Linux 8 use cgroup v1 by default with kernel 4.18, but provide backported support for cgroup v2.

Follow the steps below to enable the unified cgroup v2 hierarchy.

  1. Add the required kernel parameters using grubby to enable the unified hierarchy and disable v1 controllers:
    sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=1 cgroup_no_v1=all"
  2. Reboot the system:
    sudo reboot
  3. After the system restarts, verify that cgroup v2 is active by running:
    stat -fc %T /sys/fs/cgroup/
    The output should display cgroup2fs, confirming that cgroup v2 is active.