How to enable cGroups v2 in AlmaLinux 9

September 23, 2023
How to enable cGroups v2 in AlmaLinux.png

AlmaLinux is becoming popular day by day for the server-side OS. Besides, cGroups v2 plays a significant role in managing resources! Based on the necessity to have cGroups v2 enabled in AlmaLinux, today we will learn how to enable cGroups v2 in AlmaLinux 9.

What’s the use of cGroups v2?

cGroups v2 is the next version of the Linux cGroups API. cGroups v2 provides a unified control system with advanced resource management capabilities. It’s a kernel feature that helps to limit resource usage (CPU, memory, disk, I.O, etc.) for different users/accounts.

How to enable cGroups v2 in AlmaLinux 9?

AlmaLinux 9 supports cGroups v2. Sometimes, the cGroups v2 may be disabled. At that time, we’ll need to enable it to get its benefits.

Before starting, please check the NOTES section first. By following the process, let’s check whether cGroups v2 is enabled.

Step 01: Checking whether cGroups v2 is enabled or not:

We can find out if the cGroups v2 is enabled or not by the following command:

stat -fc %T /sys/fs/cgroup

If cGroups v1 is enabled and the cGroups v2 is disabled, then it will show below output:

How to enable cGroups v2 on AlmaLinux

As here, cGroups v2 is disabled; we need to enable it by following the next steps.

Step 02: Modifying grub:

Using the following command, we can edit the grub file.

nano /etc/default/grub

Now need to append the “ systemd.unified_cgroup_hierarchy=1 ” in “GRUB_CMDLINE_LINUX=” line
How to enable cGroups v2 on AlmaLinux

Now, we need to save it by CTRL+O & then ENTER. We are losing it by CTRL+X.

Step 03: Executing the modified grub file:

Using the following command, we have to execute the modified grub file:

grub2-mkconfig

Also, we need to use the following command:

yum update

Step 04: Restarting the system:

Now, we need to restart the system manually or using the following command:

reboot

Step 05: Rechecking if cGroups v2 is enabled or not:

After rebooting the system, we need to recheck whether cGroups v2 is enabled using the command we executed in STEP 01. If the cGroups v2 is enabled, the following output will be displayed.

How to enable cGroups v2 on AlmaLinux

ALL DONE!

Notes

  • root user access must be required for this process.
  •  To use nano, we must install it before using this feature. By default, nano is not installed in AlmaLinux 9. So, before going through the STEP 02 process, use nano is installed.
  •  Following these steps, we can enable cGroups v2 in AlmaLinux 8.x.

Md Sohanur Rahman Sakib

For me, life is like a line. Line of a circle where my presence is just like a dot. A dot, which has value or maybe hasn't!

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Recent Articles

Facebook Sound Collection: Get Copyright-Free Music

Facebook Sound Collection: Get Copyright-Free Music

If you are a content creator on Meta's platforms, this article is for you. Today, we are going to discuss Meta's feature, which is the Facebook Sound Collection. We won't face copyright-related issues by using music from here for our projects. It's free with a ton of...

read more

Related Articles

How to Install and Configure Fail2Ban in AlmaLinux 9

How to Install and Configure Fail2Ban in AlmaLinux 9

Fail2ban is an open-source & free intrusion prevention system. It's used to protect the server system against brute-force attacks. Fail2ban monitors the SSH log files for authentication attempts continuously. It's banned the client IP after a specified number of...

read more

Pin It on Pinterest

Share This