-
Notifications
You must be signed in to change notification settings - Fork 80
/
Copy pathgrub-btrfs.8
280 lines (250 loc) · 9.27 KB
/
grub-btrfs.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
.TH "grub-btrfs" "8"
.SH "NAME"
.PP
grub-btrfs - Automatically add btrfs-Snapshots as a Grub submenu
.SH "SYNOPSIS"
.PP
\fC/etc/grub.d/41_snapshots\-btrfs [\-V, \-\-version]\fP
.SH "DESCRIPTION"
.PP
Improves grub by adding “btrfs snapshots” to the grub menu.
.PP
You can boot your system on a “snapshot” from the grub menu.
Supports manual snapshots, snapper and timeshift.
Features of grub-btrfs:
.IP \(em 4
Automatically list snapshots existing on root partition (btrfs).
.IP \(em 4
Automatically detect if /boot is in separate partition.
.IP \(em 4
Automatically detect kernel, initramfs and intel/amd microcode in /boot directory on snapshots.
.IP \(em 4
Automatically create corresponding “menuentry” in grub.cfg
.IP \(em 4
Automatically detect the type/tags and descriptions/comments of snapper/timeshift snapshots.
.IP \(em 4
Automatically generate grub.cfg if you use the provided systemd service.
.SH "CONFIGURATION"
.PP
grub-btrfs is configured via the file \fC/etc/default/grub\-btrfs/config\fP.
Possible options are:
.SS "GENERAL"
.SS "\fCGRUB_BTRFS_DISABLE\fP"
.PP
Disable grub-btrfs if true.
.IP \(em 4
Default: “false”
.IP \(em 4
Example: \fCGRUB_BTRFS_DISABLE="true"\fP
.SS "\fCGRUB_BTRFS_TITLE_FORMAT\fP"
.PP
The snapshot entries submenu in Grub are added according to this line. It is possible to change to order of the fields.
.IP \(em 4
Default: (“date” “snapshot” “type” “description”)
.IP \(em 4
Example: \fCGRUB_BTRFS_TITLE_FORMAT=("date" "snapshot" "type" "description")\fP
.SS "\fCGRUB_BTRFS_LIMIT\fP"
.PP
Maximum number of snapshots in the GRUB snapshots sub menu.
.IP \(em 4
Default: “50”
.IP \(em 4
Example: \fCGRUB_BTRFS_LIMIT="50"\fP
.SS "\fCGRUB_BTRFS_SUBVOLUME_SORT\fP"
.PP
Sort the found subvolumes by “ogeneration” or “generation” or “path” or “rootid”.
.IP \(em 4
See Sorting section in
.BR btrfs-subvolume (8)
.PP
“-rootid” means list snapshot by new ones first.
.IP \(em 4
Default: “-rootid”
.IP \(em 4
Example: \fCGRUB_BTRFS_SUBVOLUME_SORT="+ogen,\-gen,path,rootid"\fP
.SS "\fCGRUB_BTRFS_SHOW_SNAPSHOTS_FOUND\fP"
.PP
Show snapshots found during run “grub-mkconfig”
.IP \(em 4
Default: “true”
.IP \(em 4
Example: \fCGRUB_BTRFS_SHOW_SNAPSHOTS_FOUND="false"\fP
.SS "\fCGRUB_BTRFS_ROOTFLAGS\fP"
.PP
Comma separated mount options to be used when booting a snapshot.
They can be defined here as well as in the “/” line inside the respective snapshots’
“/etc/fstab” files. Mount options found in both places are combined, and this variable
takes priority over `fstab` entries.
NB: Do NOT include “subvol=...” or “subvolid=...” here.
.IP \(em 4
Default: “”
.IP \(em 4
Example: \fCGRUB_BTRFS_ROOTFLAGS="space_cache,commit=10,norecovery"\fP
.SS "\fCGRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION\fP"
.PP
By default “grub-btrfs” automatically detects your boot partition,
either located at the system root or on a separate partition or in a subvolume,
Change to “true” if your boot partition is not detected as separate.
.IP \(em 4
Default: “false”
.IP \(em 4
Example: \fCGRUB_BTRFS_OVERRIDE_BOOT_PARTITION_DETECTION="true"\fP
.SS "CUSTOM KERNELS"
.SS "\fCGRUB_BTRFS_NKERNEL\fP / \fCGRUB_BTRFS_NINIT\fP / \fCGRUB_BTRFS_CUSTOM_MICROCODE\fP"
.PP
By default, “grub-btrfs” automatically detects most existing kernels, initramfs and microcode.
Customs kernel, initramfs and microcodes that are not detected can be added in these variables.
.IP \(em 4
Default: (“”)
.IP \(em 4
Example: \fCGRUB_BTRFS_NKERNEL=("kernel\-5.19.4\-custom" "vmlinux\-5.19.4\-custom")\fP
\fCGRUB_BTRFS_NINIT=("initramfs\-5.19.4\-custom.img" "initrd\-5.19.4\-custom.img" "otherinit\-5.19.4\-custom.gz")\fP
\fCGRUB_BTRFS_CUSTOM_MICROCODE=("custom\-ucode.img" "custom\-uc.img "custom_ucode.cpio")\fP
.SS "\fCGRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS\fP"
.PP
Additional kernel command line parameters that should be passed to the kernelwhen
booting a snapshot.
For dracut based distros this could be useful to pass “rd.live.overlay.overlayfs=1”
or “rd.live.overlay.readonly=1” to the Kernel for booting read only snapshots.
.IP \(em 4
Default: “”
.IP \(em 4
Example: \fCGRUB_BTRFS_SNAPSHOT_KERNEL_PARAMETERS="rd.live.overlay.overlayfs=1"\fP
.SS "SNAPSHOT FILTERING"
.SS "\fCGRUB_BTRFS_IGNORE_SPECIFIC_PATH\fP"
.PP
Ignore specific path during run “grub-mkconfig”.
Only exact paths are ignored.
e.g : if `specific path` = @, only `@` snapshot will be ignored.
.IP \(em 4
Default: (“@”)
.IP \(em 4
Example: \fCGRUB_BTRFS_IGNORE_SPECIFIC_PATH=("@home")\fP
.SS "\fCGRUB_BTRFS_IGNORE_PREFIX_PATH\fP"
.PP
Ignore prefix path during run “grub-mkconfig”.
Any path starting with the specified string will be ignored.
e.g : if `prefix path` = @, all snapshots beginning with “@/...” will be ignored.
.IP \(em 4
Default: (“var/lib/docker” “@var/lib/docker” “@/var/lib/docker”)
.IP \(em 4
Example: \fCGRUB_BTRFS_IGNORE_PREFIX_PATH=("var/lib/docker" "@var/lib/docker" "@/var/lib/docker")\fP
.SS "\fCGRUB_BTRFS_IGNORE_SNAPSHOT_TYPE\fP"
.PP
Ignore specific type/tag of snapshot during run “grub-mkconfig”.
For snapper:
Type = single, pre, post.
For Timeshift:
Tag = boot, ondemand, hourly, daily, weekly, monthly.
.IP \(em 4
Default: (“”)
.IP \(em 4
Example: \fCGRUB_BTRFS_IGNORE_SNAPSHOT_TYPE=("ondemand")\fP
.SS "\fCGRUB_BTRFS_IGNORE_SNAPSHOT_DESCRIPTION\fP"
.PP
Ignore specific description of snapshot during run “grub-mkconfig”.
.IP \(em 4
Default: (“”)
.IP \(em 4
Example: \fCGRUB_BTRFS_IGNORE_SNAPSHOT_DESCRIPTION=("timeline")\fP
.SS "DISTRIBUTION DEPENDENT SETTINGS"
.SS "\fCGRUB_BTRFS_BOOT_DIRNAME\fP"
.PP
Location of kernels/initramfs/microcode.
Used by “grub-btrfs” to detect the boot partition and the location of kernels, initramfs and microcodes.
.IP \(em 4
Default: “/boot”
.IP \(em 4
Example: \fCGRUB_BTRFS_BOOT_DIRNAME="/"\fP
.SS "\fCGRUB_BTRFS_GRUB_DIRNAME\fP"
.PP
Location of the folder containing the “grub.cfg” file.
Might be grub2 on some systems.
For example, on Fedora with EFI : “/boot/efi/EFI/fedora”
.IP \(em 4
Default: “/boot/grub”
.IP \(em 4
Example: \fCGRUB_BTRFS_GRUB_DIRNAME="/boot/grub2"\fP
.SS "\fCGRUB_BTRFS_GBTRFS_DIRNAME\fP"
.PP
Location where grub-btrfs.cfg should be saved.
Some distributions (like OpenSuSE) store those file at the snapshot directory
instead of boot. Be aware that this directory must be available for grub during
startup of the system.
.IP \(em 4
Default: \fC$GRUB_BTRFS_GRUB_DIRNAME\fP
.IP \(em 4
Example: \fCGRUB_BTRFS_GBTRFS_DIRNAME="/.snapshots"\fP
.SS "\fCGRUB_BTRFS_GBTRFS_SEARCH_DIRNAME\fP"
.PP
Location of the directory where Grub searches for the grub-btrfs.cfg file.
Some distributions (like OpenSuSE) store those file at the snapshot directory
instead of boot. Be aware that this directory must be available for grub during
startup of the system.
.IP \(em 4
Default: “\${prefix}” (This is a grub variable that resolves to where grub is
.PP
installed. (like /boot/grub, /boot/efi/grub))
.IP \(em 4
NOTE: If variables of grub are used here like ${prefix}, they need to be escaped
.PP
with `$\` before the `$`
.IP \(em 4
Example: \fCGRUB_BTRFS_GBTRFS_SEARCH_DIRNAME="\${prefix}"\fP
.SS "\fCGRUB_BTRFS_MKCONFIG\fP"
.PP
Name/path of the command to generate the grub menu, used by “grub-btrfs.service”
Might be ’grub2-mkconfig’ on some systems (e.g. Fedora)
Default paths are /sbin:/bin:/usr/sbin:/usr/bin, if your path is missing, report it on the upstream project.
You can use the name of the command only or full the path.
.IP \(em 4
Default: grub-mkconfig
.IP \(em 4
Example: \fCGRUB_BTRFS_MKCONFIG=/sbin/grub2\-mkconfig\fP
.SS "\fCGRUB_BTRFS_SCRIPT_CHECK\fP"
.PP
Name of grub-script-check command, used by “grub-btrfs”
Might be ’grub2-script-check’ on some systems (e.g. Fedora)
.IP \(em 4
Default: grub-script-check
.IP \(em 4
Example: \fCGRUB_BTRFS_SCRIPT_CHECK=grub2\-script\-check\fP
.SS "\fCGRUB_BTRFS_MKCONFIG_LIB\fP"
.PP
Path of grub-mkconfig\d\s-2lib\s+2\u file, used by “grub-btrfs”
Might be ’/usr/share/grub2/grub-mkconfig\d\s-2lib\s+2\u’ on some systems (e.g. Opensuse)
.IP \(em 4
Default: /usr/share/grub/grub-mkconfig\d\s-2lib\s+2\u
.IP \(em 4
Example: \fCGRUB_BTRFS_MKCONFIG_LIB=/usr/share/grub2/grub\-mkconfig_lib\fP
.SS "SECURITY"
.SS "\fCGRUB_BTRFS_PROTECTION_AUTHORIZED_USERS\fP"
.PP
Password protection management for submenu, snapshots
Refer to the Grub documentation \fIhttps://www.gnu.org/software/grub/manual/grub/grub.html#Authentication-and-authorisation\fP
and this comment \fIhttps://github.com/Antynea/grub-btrfs/issues/95#issuecomment-682295660\fP
Add authorized usernames separate by comma (userfoo,userbar).
When Grub’s password protection is enabled, the superuser is authorized by default, it is not necessary to add it
.IP \(em 4
Default: “”
.IP \(em 4
Example: \fCGRUB_BTRFS_PROTECTION_AUTHORIZED_USERS="userfoo,userbar"\fP
.SS "\fCGRUB_BTRFS_DISABLE_PROTECTION_SUBMENU\fP"
.PP
Disable authentication support for submenu of Grub-btrfs only (--unrestricted)
does not work if GRUB\d\s-2BTRFS\s+2\u\d\s-2PROTECTION\s+2\u\d\s-2AUTHORIZED\s+2\u\d\s-2USERS\s+2\u is not empty
.IP \(em 4
Default: “false”
.IP \(em 4
Example: \fCGRUB_BTRFS_DISABLE_PROTECTION_SUBMENU="true"\fP
.SH "FILES"
.PP
/etc/default/grub-btrfs/config
.SH "SEE ALSO"
.IR btrfs (8)
.IR btrfs-subvolume (8)
.IR grub-btrfsd (8)
.IR grub-mkconfig (8)
.SH "COPYRIGHT"
.PP
Copyright (c) 2022 Pascal Jäger