Skip to content

Instantly share code, notes, and snippets.

@flrichar
Last active November 15, 2023 21:12
Show Gist options
  • Select an option

  • Save flrichar/ee1adeb7a0c101b2c68539165d83a44a to your computer and use it in GitHub Desktop.

Select an option

Save flrichar/ee1adeb7a0c101b2c68539165d83a44a to your computer and use it in GitHub Desktop.
Grubby options, for rhel or centos

Grubby Options

Use Grubby to add or remove kernel parameters, and select the default kernel to boot into. Note, this is for primarily OpenSUSE and RHEL-like distros, Alma, Rocky etc.

  • disable selinux: sudo grubby --update-kernel=ALL --args="selinux=0"
  • list all kernels: sudo grubby --info ALL
  • default kernel by name: sudo grubby --default-kernel, set default-kernel: sudo grubby --set-default-kernel="/boot/vmlinuz-xxxxxx"
  • default kernel by index: sudo grubby --default-index, set default-index: sudo grubby --set-default-index=2

CGroups Kernel Parameters

  • default cgroup version (legacy = v1, unified = v2) ... systemctl --version | awk '{print $NF}'
  • remove cgroups v2 from kernel parameters: sudo grubby --update-kernel=$(sudo grubby --default-kernel) --remove-args="systemd.unified_cgroup_hierarchy=1"
  • force cgroups v1 in kernel parameters: sudo grubby --update-kernel=$(sudo grubby --default-kernel) --args="systemd.unified_cgroup_hierarchy=0"

For Ubuntu & Debian

  • sudo vi /etc/default/grub ... modify systemd.unified_cgroup_hierarchy=1 or zero, as needed
  • sudo update-grub & reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment