grubby
Manage GRUB2 bootloader configuration
TLDR
Add kernel boot arguments to all kernel menu entries
Remove existing arguments from the entry for the default kernel
List all kernel menu entries
SYNOPSIS
grubby [options]
PARAMETERS
--add-kernel=<KERNEL>
Add <KERNEL> to all GRUB config files
--args=<ARGS>
Set kernel boot arguments for new/updated entries
--default-kernel=<KERNEL>
Set default to matching <KERNEL> entry
--grub=<DIR>
Use GRUB config directory <DIR> (default: /boot/grub)
--grub2
Force GRUB2 mode
--initrd=<INITRD>
Set initramfs image for entry
--remove-args=<ARGS>
Remove specified args from kernels
--remove-default-kernel
Unset the default kernel
--remove-kernel=<KERNEL>
Remove matching <KERNEL> from configs
--set-default=<INDEX|KERNEL>
Set default entry by index or kernel path
--title=<TITLE>
Set menu title for new entry
--update-kernel[=<KERNEL>]
Update args/initrd for <KERNEL> or ALL
--verify
Dry-run: show changes without applying
DESCRIPTION
Grubby is a command-line tool for managing GRUB bootloader configurations, primarily in Red Hat-based Linux distributions like Fedora, RHEL, and CentOS.
It simplifies adding, removing, updating kernel entries, setting defaults, and modifying boot parameters without manually editing grub.conf or grub.cfg files. Grubby detects GRUB Legacy or GRUB2, parses existing menu entries, and applies changes atomically to prevent boot failures.
Common uses include post-install kernel hooks: adding new kernels with matching initramfs, updating arguments (e.g., rhgb quiet), or promoting kernels to default. It supports specifying entries by kernel path, title, index, or stanza.
Unlike grub-mkconfig, grubby targets specific changes efficiently, avoiding full regeneration. It's script-friendly, idempotent for many operations, and verifies changes with --verify. Ideal for automation but requires root privileges.
CAVEATS
Modifies existing configs directly; backup first. GRUB2 may need grub2-mkconfig for complex themes/scripts. Distro-specific; not for Debian/Ubuntu.
EXAMPLES
Add kernel: grubby --add-kernel=/boot/vmlinuz-6.1.0 --initrd=/boot/initramfs-6.1.0.img --title="New Kernel" --args="rhgb quiet"
Set default: grubby --set-default=/boot/vmlinuz-6.1.0
Update all: grubby --update-kernel=ALL --remove-args="rhgb"
HISTORY
Developed by Red Hat ~2004 for Fedora Core 3; matured with GRUB2 support in Fedora 10+. Maintained in grubby package for automated kernel updates.
SEE ALSO
grub-mkconfig(8), grub-install(8), update-grub(8), kernel-install(8)


