8 {pve} currently uses one of two bootloaders depending on the disk setup
9 selected in the installer.
11 For EFI Systems installed with ZFS as the root filesystem `systemd-boot` is
12 used. All other deployments use the standard `grub` bootloader (this usually
13 also applies to systems which are installed on top of Debian).
15 [[sysboot_installer_part_scheme]]
16 Partitioning scheme used by the installer
17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 The {pve} installer creates 3 partitions on the bootable disks selected for
20 installation. The bootable disks are:
22 * For Installations with `ext4` or `xfs` the selected disk
24 * For ZFS installations all disks belonging to the first `vdev`:
25 ** The first disk for RAID0
26 ** All disks for RAID1, RAIDZ1, RAIDZ2, RAIDZ3
27 ** The first two disks for RAID10
29 The created partitions are:
31 * a 1 MB BIOS Boot Partition (gdisk type EF02)
33 * a 512 MB EFI System Partition (ESP, gdisk type EF00)
35 * a third partition spanning the set `hdsize` parameter or the remaining space
36 used for the chosen storage type
38 `grub` in BIOS mode (`--target i386-pc`) is installed onto the BIOS Boot
39 Partition of all bootable disks for supporting older systems.
46 `grub` has been the de-facto standard for booting Linux systems for many years
47 and is quite well documented
48 footnote:[Grub Manual https://www.gnu.org/software/grub/manual/grub/grub.html].
50 The kernel and initrd images are taken from `/boot` and its configuration file
51 `/boot/grub/grub.cfg` gets updated by the kernel installation process.
55 Changes to the `grub` configuration are done via the defaults file
56 `/etc/default/grub` or config snippets in `/etc/default/grub.d`. To regenerate
57 the `/boot/grub/grub.cfg` after a change to the configuration run:
63 [[sysboot_systemd_boot]]
67 `systemd-boot` is a lightweight EFI bootloader. It reads the kernel and initrd
68 images directly from the EFI Service Partition (ESP) where it is installed.
69 The main advantage of directly loading the kernel from the ESP is that it does
70 not need to reimplement the drivers for accessing the storage. In the context
71 of ZFS as root filesystem this means that you can use all optional features on
72 your root pool instead of the subset which is also present in the ZFS
73 implementation in `grub` or having to create a separate small boot-pool
74 footnote:[Booting ZFS on root with grub https://github.com/zfsonlinux/zfs/wiki/Debian-Stretch-Root-on-ZFS].
76 In setups with redundancy (RAID1, RAID10, RAIDZ*) all bootable disks (those
77 being part of the first `vdev`) are partitioned with an ESP. This ensures the
78 system boots even if the first boot device fails. The ESPs are kept in sync by
79 a kernel postinstall hook script `/etc/kernel/postinst.d/zz-pve-efiboot`. The
80 script copies certain kernel versions and the initrd images to `EFI/proxmox/`
81 on the root of each ESP and creates the appropriate config files in
82 `loader/entries/proxmox-*.conf`. The `pve-efiboot-tool` script assists in
83 managing both the synced ESPs themselves and their contents.
85 The following kernel versions are configured by default:
87 * the currently running kernel
88 * the version being newly installed on package updates
89 * the two latest kernels
90 * the latest version of each kernel series (e.g. 4.15, 5.0).
92 The ESPs are not kept mounted during regular operation, in contrast to `grub`,
93 which keeps an ESP mounted on `/boot/efi`. This helps to prevent filesystem
94 corruption to the `vfat` formatted ESPs in case of a system crash, and removes
95 the need to manually adapt `/etc/fstab` in case the primary boot device fails.
97 [[sysboot_systemd_boot_config]]
101 `systemd-boot` is configured via the file `loader/loader.conf` in the root
102 directory of an EFI System Partition (ESP). See the `loader.conf(5)` manpage
105 Each bootloader entry is placed in a file of its own in the directory
108 An example entry.conf looks like this (`/` refers to the root of the ESP):
113 options root=ZFS=rpool/ROOT/pve-1 boot=zfs
114 linux /EFI/proxmox/5.0.15-1-pve/vmlinuz-5.0.15-1-pve
115 initrd /EFI/proxmox/5.0.15-1-pve/initrd.img-5.0.15-1-pve
119 .Manually keeping a kernel bootable
121 Should you wish to add a certain kernel and initrd image to the list of
122 bootable kernel use `pve-efiboot-tool kernel add`.
124 For example run the following to add the kernel with ABI version `5.0.15-1-pve`
125 to the list of kernels to keep installed and synced to all ESPs:
128 pve-efiboot-tool kernel add 5.0.15-1-pve
131 `pve-efiboot-tool kernel list` will list all kernel versions currently selected
135 # pve-efiboot-tool kernel list
136 Manually selected kernels:
139 Automatically selected kernels:
144 Run `pve-efiboot-tool remove` to remove a kernel from the list of manually
145 selected kernels, for example:
148 pve-efiboot-tool kernel remove 5.0.15-1-pve
152 [[sysboot_systemd_boot_setup]]
153 .Setting up a new partition for use as synced ESP
155 To format and initialize a partition as synced ESP, e.g., after replacing a
156 failed vdev in an rpool, or when converting an existing system that pre-dates
157 the sync mechanism, `pve-efiboot-tool` from `pve-kernel-helpers` can be used.
159 WARNING: the `format` command will format the `<partition>`, make sure to pass
160 in the right device/partition!
162 For example, to format an empty partition `/dev/sda2` as ESP, run the following:
165 pve-efiboot-tool format /dev/sda2
168 To setup an existing, unmounted ESP located on `/dev/sda2` for inclusion in
169 {pve}'s kernel update synchronization mechanism, use the following:
172 pve-efiboot-tool init /dev/sda2
175 Afterwards `/etc/kernel/pve-efiboot-uuids` should contain a new line with the
176 UUID of the newly added partition. The `init` command will also automatically
177 trigger a refresh of all configured ESPs.
179 [[sysboot_systemd_boot_refresh]]
180 .Updating the configuration on all ESPs
182 To copy and configure all bootable kernels and keep all ESPs listed in
183 `/etc/kernel/pve-efiboot-uuids` in sync you just need to run `pve-efiboot-tool
185 (The equivalent to running `update-grub` on Systems being booted with `grub`).
187 This is necessary should you make changes to the kernel commandline, or want to
188 sync all kernels and initrds after regenerating the latter.
190 [[sysboot_edit_kernel_cmdline]]
191 Editing the kernel commandline
192 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194 You can modify the kernel commandline in the following places, depending on the
199 The kernel commandline needs to be placed in the variable
200 `GRUB_CMDLINE_LINUX_DEFAULT` in the file `/etc/default/grub`. Running
201 `update-grub` appends its content to all `linux` entries in
202 `/boot/grub/grub.cfg`.
206 The kernel commandline needs to be placed as line in `/etc/kernel/cmdline`
207 Running `/etc/kernel/postinst.d/zz-pve-efiboot` sets it as `option` line for
208 all config files in `loader/entries/proxmox-*.conf`.