This is a topic that I haven’t reviewed much or probably nothing at all. When your Linux system boots, GRUB loads the Linux kernel and passes its options. These kernel options can help us:

  • Debug boot issues
  • Enable or disable hardware drivers
  • Enter specific modes (like single-user)

When to use bootloader GRUB command at boot time?

  • Troubleshooting boot problems
  • Disabling a problematic device driver
  • Entering rescue or single-user mode
  • Disabling graphical splash or enabling logs
  • Passing custom memory or CPU settings

You can pass kernel command parameters to GRUB at boot time or make it permanent. For now, I’m going to decide which coffee from Latin America I’m going to brew at home.

Pass kernel parameters temporarily

Interrupt GRUB at boot time and when the menu appears do:

Press e to edit the boot entry.

You may see this line:

linux   /boot/vmlinuz-5.15.0-91-generic root=UUID=xxxx ro quiet splash

You can append options at the end of the line starting with linux. For example to boot into single-user mode:

linux   /boot/vmlinuz-... root=UUID=... ro single

or

linux   /boot/vmlinuz-... root=UUID=... ro init=/bin/bash

Common used kernel boot options

OptionPurposeExample Usage
singleBoot into single-user modelinux ... ro single
init=/bin/bashStart with Bash shell instead of init/systemdlinux ... ro init=/bin/bash
nomodesetPrevent kernel mode-setting (graphics troubleshooting)linux ... ro quiet splash nomodeset
quietSuppresses most boot messageslinux ... ro quiet
splashShow splash screenlinux ... ro splash
noapic, nolapicDisables APIC / Local APIC (used for IRQ troubleshooting)linux ... noapic nolapic
acpi=offDisables ACPI (power management, battery issues)linux ... acpi=off
mem=512MLimit usable memorylinux ... mem=512M
root=/dev/sdXnSpecify root device (overrides default)linux ... root=/dev/sda1

Make changes permanent if you want

Edit /etc/default/grub with your favorite editor. I like to use vim.

Find this line:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Modify it using the options in the table above. For example you can do:

GRUB_CMDLINE_LINUX_DEFAULT="quiet single nomodeset"

Then update GRUB:

sudo update-grub      # Debian/Ubuntu
sudo grub2-mkconfig -o /boot/grub2/grub.cfg   # RHEL/CentOS

View the current kernel command line configuration

You can simply run this command in your Terminal:

cat /proc/cmdline

You should see something like this:

Linux bootloader(GRUB) common commands

Keep in mind the below for Linux bootloader

  • Always test kernel parameters temporarily first.
  • If a parameter causes issues, reboot and remove it.
  • Kernel parameters are space-separated.

Leave a comment

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