← 返回命令列表

Linux command

grubby 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo grubby --update-kernel=ALL --args 'quiet console=ttyS0'

Remove

sudo grubby --update-kernel=DEFAULT --remove-args quiet

List

sudo grubby --info=ALL

说明

grubby is a command-line tool for updating and modifying bootloader configuration on Red Hat-based systems. It works with GRUB, GRUB2, and zipl (for s390 systems), providing a unified interface for boot configuration changes. The tool modifies kernel command-line arguments, manages boot entries, and sets default kernels without directly editing configuration files. On modern Fedora/RHEL systems using GRUB2 with BLS (Boot Loader Specification), grubby modifies the individual kernel entry files in /boot/loader/entries/.

参数

--info=_KERNEL_
Display boot information for specified kernel (or ALL)
--update-kernel=_KERNEL_
Update specified kernel (ALL, DEFAULT, or path)
--args=_ARGS_
Add kernel arguments
--remove-args=_ARGS_
Remove kernel arguments
--set-default=_KERNEL_
Set default boot kernel
--default-kernel
Display path of default kernel
--default-index
Display index of default kernel
--add-kernel=_PATH_
Add a new kernel entry
--remove-kernel=_PATH_
Remove a kernel entry
--title=_TITLE_
Set title for new kernel entry

FAQ

What is the grubby command used for?

grubby is a command-line tool for updating and modifying bootloader configuration on Red Hat-based systems. It works with GRUB, GRUB2, and zipl (for s390 systems), providing a unified interface for boot configuration changes. The tool modifies kernel command-line arguments, manages boot entries, and sets default kernels without directly editing configuration files. On modern Fedora/RHEL systems using GRUB2 with BLS (Boot Loader Specification), grubby modifies the individual kernel entry files in /boot/loader/entries/.

How do I run a basic grubby example?

Run `sudo grubby --update-kernel=ALL --args 'quiet console=ttyS0'` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --info=_KERNEL_ do in grubby?

Display boot information for specified kernel (or ALL)