1GRUBBY(8) System Manager's Manual GRUBBY(8)
2
3
4
6 grubby - command line tool used to configure bootloader menu entries
7 across multiple architectures
8
9
11 grubby [OPTIONS]
12
13
15 General Information
16 grubby is a command line tool for updating and displaying information
17 about the configuration files for various architecture specific boot‐
18 loaders. It is primarily designed to be used from scripts which
19 install new kernels and need to find information about the current boot
20 environment.
21
22
23 Architecture Support
24 The grubby executable has full support for the grub2 bootloader on
25 x86_64 systems using legacy BIOS or modern UEFI firmware and ppc64 and
26 ppc64le hardware using OPAL or SLOF as firmware.
27
28 Legacy s390 and the current s390x architectures and their zipl boot‐
29 loader are fully supported.
30
31 Support for yaboot has been deprecated as all ppc architecture hardware
32 since the Power8 uses grub2 or petitboot which both use the grub2 con‐
33 figuration file format.
34
35 Legacy bootloaders LILO, SILO, and ELILO are deprecated and no longer
36 receiving active support in favor of previously mentioned bootloaders.
37
38
39 Default Behavior
40 The default bootloader target is primarily determined by the architec‐
41 ture for which grubby has been built. Each architecture has a pre‐
42 ferred bootloader, and each bootloader has its own configuration file.
43 If no bootloader is selected on the command line, grubby will use these
44 default settings to search for an existing configuration. If no boot‐
45 loader configuration file is found, grubby will use the default value
46 for that architecture. These defaults are listed in the table below.
47
48
49 ┌────────────────┬────────────┬─────────────────────────────────┐
50 │ Arch │ Bootloader │ Configuration File │
51 ├────────────────┼────────────┼─────────────────────────────────┤
52 │ x86_64 [BIOS] │ grub2 │ /boot/grub2/grub.cfg │
53 ├────────────────┼────────────┼─────────────────────────────────┤
54 │ x86_64 [UEFI] │ grub2 │ /boot/efi/EFI/redhat/grub.cfg │
55 ├────────────────┼────────────┼─────────────────────────────────┤
56 │ i386 │ grub2 │ /boot/grub2/grub.cfg │
57 ├────────────────┼────────────┼─────────────────────────────────┤
58 │ ia64 │ elilo │ /boot/efi/EFI/redhat/elilo.conf │
59 ├────────────────┼────────────┼─────────────────────────────────┤
60 │ ppc [>=Power8] │ grub2 │ /boot/grub2/grub.cfg │
61 ├────────────────┼────────────┼─────────────────────────────────┤
62 │ ppc [<=Power7] │ yaboot │ /etc/yaboot.conf │
63 ├────────────────┼────────────┼─────────────────────────────────┤
64 │ s390 │ zipl │ /etc/zipl.conf │
65 ├────────────────┼────────────┼─────────────────────────────────┤
66 │ s390x │ zipl │ /etc/zipl.conf │
67 └────────────────┴────────────┴─────────────────────────────────┘
68
69
70 Special Arguments
71 There are a number of ways to specify the kernel used for --info,
72 --remove-kernel, and --update-kernel. Specifying DEFAULT or ALL selects
73 the default entry and all of the entries, respectively. If a comma
74 separated list of numbers is given, the boot entries indexed by those
75 numbers are selected. Finally, the title of a boot entry may be speci‐
76 fied by using TITLE=title as the argument; all entries with that title
77 are used.
78
79
81 Basic Options
82 --add-kernel=kernel-path
83 Add a new boot entry for the kernel located at kernel-path. A
84 title for the boot entry must be set using --title. Most invoca‐
85 tions should also include --initrd with memtest86 as a notable
86 exception.
87
88 The --update-kernel option may not be used in the same invoca‐
89 tion.
90
91
92 --remove-kernel=kernel-path
93 Remove all boot entries which match kernel-path. This may be
94 used along with --add-kernel, in which case the new entry being
95 added will not be removed.
96
97
98 --update-kernel=kernel-path
99 Update the entries for kernels matching kernel-path. Currently
100 the only item that can be updated is the kernel argument list,
101 which is modified via the --args and --remove-args options.
102
103
104 --args=kernel-args
105 When a new kernel is added, this specifies the command line
106 arguments which should be passed to the kernel by default (note
107 they are merged with the arguments from the template if --copy-
108 default is used). When --update-kernel is used, this specifies
109 new arguments to add to the argument list. Multiple, space sepa‐
110 rated arguments may be used. If an argument already exists the
111 new value replaces the old values. The root= kernel argument
112 gets special handling if the configuration file has special han‐
113 dling for specifying the root filesystem (like lilo.conf does).
114
115
116 --remove-args=kernel-args
117 The arguments specified by kernel-args are removed from the ker‐
118 nels specified by --update-kernel. The root argument gets spe‐
119 cial handling for configuration files that support separate root
120 filesystem configuration.
121
122
123 --copy-default
124 grubby will copy as much information (such as kernel arguments
125 and root device) as possible from the current default kernel.
126 The kernel path and initrd path will never be copied.
127
128
129 --title=entry-title
130 When a new kernel entry is added entry-title is used as the
131 title (lilo label) for the entry. If entry-title is longer then
132 maximum length allowed by the bootloader (15 for lilo, unlimited
133 for grub and elilo) the title is shortened to a (unique) entry.
134
135
136 --initrd=initrd-path
137 Use initrd-path as the path to an initial ram disk for a new
138 kernel being added.
139
140
141 --efi Use appropriate bootloader commands for EFI on this architec‐
142 ture.
143
144
145 --set-default=kernel-path
146 The first entry which boots the specified kernel is made the
147 default boot entry. This may not be invoked with --set-default-
148 index.
149
150
151 --set-default-index=entry-index
152 Makes the given entry number the default boot entry. This may
153 not be invoked with --set-default. The given value represents
154 the index in the post-modification boot entry list.
155
156
157 --make-default
158 Make the new kernel entry being added the default entry.
159
160
161 --set-index=entry-index
162 Set the position at which to add a new entry created with --add-
163 kernel.
164
165
166 --debug
167 Display extra debugging information for failures.
168
169
170 -i, --extra-initrd=initrd-path
171 Use initrd-path as the path for an auxiliary initrd image.
172
173
174 Display Options
175 Passing the display option to grubby will cause it to print out the
176 requested information about the current bootloader configuration and
177 then immediately exit. These options should not be used in any script
178 intended to update the bootloader configuration.
179
180
181 --default-kernel
182 Display the full path to the current default kernel and exit.
183
184
185 --default-index
186 Display the numeric index of the current default boot entry and
187 exit.
188
189
190 --default-title
191 Display the title of the current default boot entry and exit.
192
193
194 --info=kernel-path
195 Display information on all boot entries which match kernel-path.
196 If kernel-path is DEFAULT, then information on the default ker‐
197 nel is displayed. If kernel-path is ALL, then information on all
198 boot entries are displayed.
199
200
201 --bootloader-probe
202 Attempt to probe for installed bootloaders. If this option is
203 specified, grubby tries to determine if grub or lilo is cur‐
204 rently installed. When one of those bootloaders is found the
205 name of that bootloader is displayed on stdout. Both could be
206 installed (on different devices), and grubby will print out the
207 names of both bootloaders, one per line. The probe for grub
208 requires a commented out boot directive grub.conf identical to
209 the standard directive in the lilo configuration file. If this
210 is not present grubby will assume grub is not installed (note
211 that anaconda places this directive in grub.conf files it cre‐
212 ates).
213
214 This option is only available on x86 BIOS platforms.
215
216
217 -v, --version
218 Display the version of grubby being run and then exit immedi‐
219 ately.
220
221
222 Output Format Options
223 Sane default options for the current platform are compiled into grubby
224 on a per platform basis. These defaults determine the format and layout
225 of the generated bootloader configuration file. A different configura‐
226 tion file format may be specified on the command line if the system
227 uses a supported alternative bootloader.
228
229
230 --elilo
231 Use an elilo style configuration file. This is the default on
232 ia64 platforms. This format is deprecated.
233
234
235 --extlinux
236 Use an extlinux style configuration file. This format is depre‐
237 cated.
238
239
240 --grub Use a grub style configuration file. This is the default on the
241 i386 architecture.
242
243
244 --grub2
245 Use a grub2 style configuration file. This is the default on
246 x86_64 architecture as well as the ppc64 and ppc64le architec‐
247 tures running on Power8 or later hardware.
248
249
250 --lilo Use a lilo style configuration file.
251
252
253 --silo Use a silo style configuration file. This is the default on
254 SPARC systems. This format is legacy, deprecated, and unsup‐
255 ported.
256
257
258 --yaboot
259 Use a yaboot style configuration file. This is the default for
260 the ppc architecture on on Power7 and earlier hardware.
261
262
263 --zipl Use a zipl style configuration file. This is the default on the
264 legacy s390 and current s390x architectures.
265
266
267 Override Options
268 --bad-image-okay
269 When grubby is looking for a entry to use for something (such as
270 a template or a default boot entry) it uses sanity checks, such
271 as ensuring that the kernel exists in the filesystem, to make
272 sure entries that obviously won't work aren't selected. This
273 option overrides that behavior, and is designed primarily for
274 testing.
275
276
277 --boot-filesystem=bootfs
278 The grub boot loader expects file paths listed in its configura‐
279 tion path to be relative to the top of the filesystem they are
280 on, rather then relative to the current root filesystem. By
281 default grubby searches the list of currently mounted filesys‐
282 tems to determine this. If this option is given grubby acts as
283 if the specified filesystem was the filesystem containing the
284 kernel (this option is designed primarily for testing).
285
286
287 --env=path
288 Path for the file where grub environment data is stored.
289
290
291 -c, --config-file=path
292 Use path as the configuration file rather then the default.
293
294
295 -o, --output-file=file_path
296 The destination path for the updated configuration file. Use "-"
297 to send it to stdout.
298
299
300 --devtree=file_path
301 Use path for device tree path in place of the path of any
302 devicetree directive found in the template stanza.
303
304
305 --devtreedir=file_path
306 Use the specified file path to load the devicetree definition.
307 This is for platforms where a flat file is used instead of
308 firmware to instruct the kernel how to communicate with devices.
309
310
311 Multiboot Options
312 The Multiboot Specification provides a generic interface for boot load‐
313 ers and operating systems. It is supported by the GRUB bootloader.
314
315
316 --add-multiboot=multiboot-path
317 Add a new boot entry for the multiboot kernel located at multi‐
318 boot-path. Note that this is generally accompanied with a
319 --add-kernel option.
320
321
322 --remove-multiboot=multiboot-path
323 Removes all boot entries which match multiboot-path.
324
325
326 --mbargs=multiboot-args
327 When a new multiboot kernel is added, this specifies the command
328 line arguments which should be passed to that kernel by default
329 When --update-kernel is used, this specifies new arguments to
330 add to the argument list. Multiple, space separated arguments
331 may be used. If an argument already exists the new value
332 replaces the old values.
333
334
335 --remove-mbargs=multiboot-args
336 The arguments specified by multiboot-args are removed from the
337 kernels specified by --update-kernel.
338
339
341 The command line syntax is more than a little baroque. This probably
342 won't be fixed as grubby is only intended to be called from shell
343 scripts which can get it right.
344
345
347 The following examples assume the following:
348
349
350 ┌────────────────┬─────────────────────────────────────────────┐
351 │ cfg_file │ Full path to bootloader config file │
352 ├────────────────┼─────────────────────────────────────────────┤
353 │ new_kernel │ Full path to kernel image to be installed │
354 ├────────────────┼─────────────────────────────────────────────┤
355 │ old_kernel │ Full path to old kernel image to be removed │
356 ├────────────────┼─────────────────────────────────────────────┤
357 │ current_kernel │ Full path to a currently installed kernel │
358 ├────────────────┼─────────────────────────────────────────────┤
359 │ entry_title │ Title that appears on bootloader menu │
360 ├────────────────┼─────────────────────────────────────────────┤
361 │ new_initrd │ Full path to initrd for a new kernel │
362 ├────────────────┼─────────────────────────────────────────────┤
363 │ kernel_args │ Set of arguments for the kernel │
364 ├────────────────┼─────────────────────────────────────────────┤
365 │ menu_index │ Index number of a menu entry │
366 └────────────────┴─────────────────────────────────────────────┘
367 The examples below quote strings that may have spaces or other white‐
368 space in them. It is also perfectly valid to backslash escape these
369 strings if that is more convenient.
370
371
372 Add a new kernel entry and copy all options from the current default
373 kernel. This is the behavior that most users will want.
374
375 grubby --add-kernel=new_kernel --title="entry_title" --ini‐
376 trd="new_initrd" --copy-default
377
378 Add a new kernel entry with custom arguments
379
380 grubby --add-kernel=new_kernel --title="entry_title" --ini‐
381 trd="new_initrd" --args=kernel_args
382
383 Remove all menu entries for a specified kernel.
384
385 grubby --remove-kernel=old_kernel
386
387 Target a single menu entry to remove without targetting other entries
388 with the same kernel.
389
390 grubby --info=old_kernel
391
392 grubby --remove-kernel=menu_index
393
394 Update the arguments for all entries of a specific kernel. New argu‐
395 ments get added while existing arguments get updated values.
396
397 grubby --update-kernel=current_kernel --args="kernel_args"
398
399 Remove the arguments for a single entry of a specific kernel.
400
401 grubby --info=current_kernel
402
403 grubby --remove-args=menu_index --args="kernel_args"
404
405
407 grub(8), lilo(8), yaboot(8), zipl(8), dracut(8), mkinitrd(8)
408
409
411 Erik Troan
412 Jeremy Katz
413 Peter Jones
414 Robert Marshall
415
416
417
418 Tue Jan 18 2005 GRUBBY(8)