1GRUBBY(8)                   System Manager's Manual                  GRUBBY(8)
2
3
4

NAME

6       grubby  -  command  line tool used to configure bootloader menu entries
7       across multiple architectures
8
9

SYNOPSIS

11       grubby [OPTIONS]
12
13

DESCRIPTION

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       ┌────────────────┬────────────┬─────────────────────────────────┐
50Arch           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

OPTIONS

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              I
197
198
199       --bootloader-probe
200              Attempt to probe for installed bootloaders.  If this  option  is
201              specified,  grubby  tries  to  determine if grub or lilo is cur‐
202              rently installed. When one of those  bootloaders  is  found  the
203              name  of  that bootloader is displayed on stdout.  Both could be
204              installed (on different devices), and grubby will print out  the
205              names  of  both  bootloaders,  one  per line. The probe for grub
206              requires a commented out boot directive grub.conf  identical  to
207              the  standard  directive in the lilo configuration file. If this
208              is not present grubby will assume grub is  not  installed  (note
209              that  anaconda  places this directive in grub.conf files it cre‐
210              ates).
211
212              This option is only available on x86 BIOS platforms.
213
214
215       -v, --version
216              Display the version of grubby being run and  then  exit  immedi‐
217              ately.
218
219
220   Output Format Options
221       Sane  default options for the current platform are compiled into grubby
222       on a per platform basis. These defaults determine the format and layout
223       of  the generated bootloader configuration file. A different configura‐
224       tion file format may be specified on the command  line  if  the  system
225       uses a supported alternative bootloader.
226
227
228       --elilo
229              Use  an  elilo  style configuration file. This is the default on
230              ia64 platforms. This format is deprecated.
231
232
233       --extlinux
234              Use an extlinux style configuration file. This format is  depre‐
235              cated.
236
237
238       --grub Use  a grub style configuration file. This is the default on the
239              i386 architecture.
240
241
242       --grub2
243              Use a grub2 style configuration file. This  is  the  default  on
244              x86_64  architecture  as well as the ppc64 and ppc64le architec‐
245              tures running on Power8 or later hardware.
246
247
248       --lilo Use a lilo style configuration file.
249
250
251       --silo Use a silo style configuration file.  This  is  the  default  on
252              SPARC  systems.  This  format  is legacy, deprecated, and unsup‐
253              ported.
254
255
256       --yaboot
257              Use a yaboot style configuration file. This is the  default  for
258              the ppc architecture on on Power7 and earlier hardware.
259
260
261       --zipl Use  a zipl style configuration file. This is the default on the
262              legacy s390 and current s390x architectures.
263
264
265   Override Options
266       --bad-image-okay
267              When grubby is looking for a entry to use for something (such as
268              a  template or a default boot entry) it uses sanity checks, such
269              as ensuring that the kernel exists in the  filesystem,  to  make
270              sure  entries  that  obviously  won't work aren't selected. This
271              option overrides that behavior, and is  designed  primarily  for
272              testing.
273
274
275       --boot-filesystem=bootfs
276              The grub boot loader expects file paths listed in its configura‐
277              tion path to be relative to the top of the filesystem  they  are
278              on,  rather  then  relative  to  the current root filesystem. By
279              default grubby searches the list of currently  mounted  filesys‐
280              tems  to  determine this. If this option is given grubby acts as
281              if the specified filesystem was the  filesystem  containing  the
282              kernel (this option is designed primarily for testing).
283
284
285       --env=path
286              Path for the file where grub environment data is stored.
287
288
289       -c, --config-file=path
290              Use path as the configuration file rather then the default.
291
292
293       -o, --output-file=file_path
294              The destination path for the updated configuration file. Use "-"
295              to send it to stdout.
296
297
298   Multiboot Options
299       The Multiboot Specification provides a generic interface for boot load‐
300       ers and operating systems.  It is supported by the GRUB bootloader.
301
302
303       --add-multiboot=multiboot-path
304              Add  a new boot entry for the multiboot kernel located at multi‐
305              boot-path.  Note that  this  is  generally  accompanied  with  a
306              --add-kernel option.
307
308
309       --remove-multiboot=multiboot-path
310              Removes all boot entries which match multiboot-path.
311
312
313       --mbargs=multiboot-args
314              When a new multiboot kernel is added, this specifies the command
315              line arguments which should be passed to that kernel by  default
316              When  --update-kernel  is  used, this specifies new arguments to
317              add to the argument list. Multiple,  space  separated  arguments
318              may  be  used.  If  an  argument  already  exists  the new value
319              replaces the old values.
320
321
322       --remove-mbargs=multiboot-args
323              The arguments specified by multiboot-args are removed  from  the
324              kernels specified by --update-kernel.
325
326

BUGS

328       The  command  line  syntax is more than a little baroque. This probably
329       won't be fixed as grubby is only  intended  to  be  called  from  shell
330       scripts which can get it right.
331
332

EXAMPLE

334       The following examples assume the following:
335
336
337       ┌────────────────┬─────────────────────────────────────────────┐
338cfg_file │ Full path to bootloader config file         │
339       ├────────────────┼─────────────────────────────────────────────┤
340new_kernel │ Full path to kernel image to be installed   │
341       ├────────────────┼─────────────────────────────────────────────┤
342old_kernel │ Full path to old kernel image to be removed │
343       ├────────────────┼─────────────────────────────────────────────┤
344current_kernel │ Full path to a currently installed kernel   │
345       ├────────────────┼─────────────────────────────────────────────┤
346entry_title │ Title that appears on bootloader menu       │
347       ├────────────────┼─────────────────────────────────────────────┤
348new_initrd │ Full path to initrd for a new kernel        │
349       ├────────────────┼─────────────────────────────────────────────┤
350kernel_args │ Set of arguments for the kernel             │
351       ├────────────────┼─────────────────────────────────────────────┤
352menu_index │ Index number of a menu entry                │
353       └────────────────┴─────────────────────────────────────────────┘
354       The  examples  below quote strings that may have spaces or other white‐
355       space in them. It is also perfectly valid  to  backslash  escape  these
356       strings if that is more convenient.
357
358
359       Add  a  new  kernel entry and copy all options from the current default
360       kernel.  This is the behavior that most users will want.
361
362              grubby  --add-kernel=new_kernel   --title="entry_title"   --ini‐
363              trd="new_initrd" --copy-default
364
365       Add a new kernel entry with custom arguments
366
367              grubby   --add-kernel=new_kernel   --title="entry_title"  --ini‐
368              trd="new_initrd" --args=kernel_args
369
370       Remove all menu entries for a specified kernel.
371
372              grubby --remove-kernel=old_kernel
373
374       Target a single menu entry to remove without targetting  other  entries
375       with the same kernel.
376
377              grubby --info=old_kernel
378
379              grubby --remove-kernel=menu_index
380
381       Update  the  arguments  for all entries of a specific kernel. New argu‐
382       ments get added while existing arguments get updated values.
383
384              grubby --update-kernel=current_kernel --args="kernel_args"
385
386       Remove the arguments for a single entry of a specific kernel.
387
388              grubby --info=current_kernel
389
390              grubby --remove-args=menu_index --args="kernel_args"
391
392

SEE ALSO

394       grub(8), lilo(8), yaboot(8), zipl(8), dracut(8), mkinitrd(8)
395
396

AUTHORS

398       Erik Troan
399       Jeremy Katz
400       Peter Jones
401       Robert Marshall
402
403
404
405                                Tue Jan 18 2005                      GRUBBY(8)
Impressum