Your company here — click to reach over 10,000 unique daily visitors

grubby - Man Page

command line tool for configuring grub and zipl

Examples (TL;DR)


grubby [--add-kernel=kernel-path] [--args=args]
      [--bad-image-okay] [--config-file=path] [--copy-default]
      [--default-kernel] [--default-index] [--default-title]
      [--env=path] [--grub2] [--info=kernel-path]
      [--initrd=initrd-path] [--extra-initrd=initrd-path]
      [--make-default] [--remove-args=args]
      [--remove-kernel=kernel-path] [--set-default=kernel-path]
      [--set-default-index=entry-index] [--title=ntry-title]
      [--update-kernel=kernel-path] [--zipl] [--bls-directory=path]


grubby is a command line tool for updating and displaying information about the configuration files for the grub2 and zipl boot loaders. It is primarily designed to be used from scripts which install new kernels and need to find information about the current boot environment.

On BIOS-based Intel x86, PowerPC and UEFI-based platforms, grub2 is the default bootloader and the configuration file is in /boot/grub2/grub.cfg. On s390x platforms, the zipl bootloader use a default configuration in /etc/zipl.conf.

All bootloaders define the boot entries as individual configuration fragments that are stored by default in /boot/loader/entries. The format for the config files is specified at https://systemd.io/BOOT_LOADER_SPECIFICATION. The grubby tool is used to update and display the configuration defined in the BootLoaderSpec fragment files.

There are a number of ways to specify the kernel used for --info, --remove-kernel, and --update-kernel. Specificying DEFAULT or ALL selects the default entry and all of the entries, respectively. Also, the title of a boot entry may be specified by using TITLE=title as the argument; all entries with that title are used.



Add a new boot entry for the kernel located at kernel-path.


When a new kernel is added, this specifies the command line arguments which should be passed to the kernel by default (note they are merged with the arguments of the default entry if --copy-default is used). When --update-kernel is used, this specifies new arguments to add to the argument list. Multiple, space separated arguments may be used. If an argument already exists the new value replaces the old values. The root= kernel argument gets special handling if the configuration file has special handling for specifying the root filesystem.


When grubby is looking for an entry to use for something (such as a default boot entry) it uses sanity checks, such as ensuring that the kernel exists in the filesystem, to make sure entries that obviously won't work aren't selected. This option overrides that behavior, and is designed primarily for testing.


Use path as the configuration file rather then the default.


grubby will copy as much information (such as kernel arguments and root device) as possible from the current default kernel. The kernel path and initrd path will never be copied.


Display the full path to the current default kernel and exit.


Display the numeric index of the current default boot entry and exit.


Display the title of the current default boot entry and exit.


Use path as the grub2 environment block file rather then the default path.


Configure grub2 bootloader.


Display information on all boot entries which match kernel-path. If kernel-path is DEFAULT, then information on the default kernel is displayed. If kernel-path is ALL, then information on all boot entries are displayed.


Use initrd-path as the path to an initial ram disk for a new kernel being added.


Use initrd-path as the path to an auxiliary init ram disk image to be added to the boot entry.


Make the new kernel entry being added the default entry.


The arguments specified by kernel-args are removed from the kernels specified by --update-kernel. The root argument gets special handling for configuration files that support separate root filesystem configuration.


Removes all boot entries which match kernel-path. This may be used along with --add-kernel, in which case the new kernel being added will never be removed.


The first entry which boots the specified kernel is made the default boot entry.


Makes the given entry number the default boot entry.


When a new kernel entry is added entry-title is used as the title for the entry.


The entries for kernels matching kernel-path are updated. Currently the only items that can be updated is the kernel argument list, which is modified via the --args and --remove-args options. If the ALL argument is used the variable GRUB_CMDLINE_LINUX in /etc/default/grub is updated with the latest kernel argument list, unless the --no-etc-grub-update option is used or the file does not exist (e.g., on s390x).


Configure zipl bootloader.


Use path as the directory for the BootLoaderSpec config files rather than the default /boot/loader/entries.


Makes grubby to not update the GRUB_CMDLINE_LINUX variable in /etc/default/grub when the --update-kernel option is used with the ALL argument.

See Also

zipl(8), mkinitrd(8), kernel-install(8)


Erik Troan
Jeremy Katz
Peter Jones
Javier Martinez

Referenced By


Wed Apr 29 2020