1REFIND-MKDEFAULT(8) rEFInd Manual REFIND-MKDEFAULT(8)
2
3
4
5any later version
6
8 refind-mkdefault - Set rEFInd as the default EFI boot option
9
11 refind-mkdefault [ -L|--label <name> ]
12
13
15 EFI booting normally relies on boot manager entries stored in NVRAM,
16 which describe the locations of EFI boot programs and the order in
17 which the firmware will attempt to launch them. In Linux, these entries
18 can be created, deleted, and manipulated with the efibootmgr utility.
19
20 Many OSes and Linux packages assume that they should control the boot
21 process, and so both create NVRAM boot entries for themselves and set
22 these entries first in the boot order. If you intend rEFInd to control
23 the boot process, though, such changes are undesirable and require ad‐
24 justment via efibootmgr. Such adjustments are annoying to make and can
25 be intimidating to non-experts.
26
27 The refind-mkdefault script simplifies matters: Running this script
28 with no options sets rEFInd as the default boot program. The details of
29 what the script does depends on the current state of the boot order
30 list and existing boot entries:
31
32
33 * If a rEFInd entry already exists in the boot order and is al‐
34 ready first in the list, no changes are made.
35
36
37 * If a rEFInd entry already exists in the boot order but is not
38 first in the list, that entry is moved to the first position in
39 the boot order.
40
41
42 * If more than one rEFInd entry exists in the boot order, refind-
43 mkdefault moves the one that comes earliest to the front of the
44 boot order list.
45
46
47 * If no rEFInd entry exists in the boot order but a rEFInd boot
48 entry can be found in the list of Boot#### entries, it is added
49 to the boot order and placed at the front of the list.
50
51
52 * If multiple rEFInd boot entries exist but none is in the boot
53 order, all the entries are added to the boot order, but which
54 one is first is uncontrolled.
55
56
57 A rEFInd entry is defined as one that contains the string refind (case-
58 insensitive). This string could exist in the description or in the
59 filename. The string used to define the rEFInd entry can be changed via
60 the --label (-L) option.
61
62 The intent is that refind-mkdefault can be called after booting via
63 GRUB or some other means to restore rEFInd as the default boot program.
64 It can also be placed in a startup and/or shutdown script to restore
65 rEFInd to its default position automatically. Because it does not re-
66 write the boot order if rEFInd is listed as the first boot entry, this
67 practice should be low in risk.
68
69
71 -L | --label <name>
72 Instead of searching for the string refind in efibootmgr output
73 as a way to identify rEFInd, search for the string name.
74
75
77 refind-mkdefault returns the following values:
78
79
80 0 The script completed successfully, which can mean either that no
81 change was necessary or that the call to efibootmgr returned a
82 success code.
83
84
85 1 EFI boot order variables are available, and a rEFInd entry was
86 found, but the call to efibootmgr returned a failure code.
87
88
89 2 EFI boot entries are not available. This condition is often an
90 indication of a buggy EFI or badly damaged NVRAM contents.
91
92
93 3 No rEFInd entry could be found in the list of boot options, and
94 so no changes were made to the boot order list.
95
96
97 4 The script could not run because of OS issues -- the OS was not
98 Linux, the efibootmgr utility was not available, or the script
99 was not run as root.
100
101
103 * refind-mkdefault does not work when booted in BIOS mode (includ‐
104 ing via a Compatibility Support Module, or CSM, on an EFI-based
105 computer). Similarly, it does not work if efibootmgr is not in‐
106 stalled or fails to work for any reason.
107
108
109 * The script uses a very simple algorithm to determine what to
110 move to the start of the boot order list. This algorithm may
111 fail if the system has redundant or non-functional rEFInd boot
112 entries or if those entries are not named in an expected fash‐
113 ion. Cleaning up the boot entries by manual use of efibootmgr
114 may be necessary in such cases.
115
116
118 Primary author: Roderick W. Smith (rodsmith@rodsbooks.com)
119
120
122 mvrefind(8), mkrlconf(8), refind-install(8), efibootmgr(8).
123
124 https://www.rodsbooks.com/refind/
125
126
128 The refind-mkdefault command is part of the rEFInd package and is
129 available from Roderick W. Smith.
130
131
132
133Roderick W. Smith 0.13.3 REFIND-MKDEFAULT(8)