Boot Loader
systemd-boot
Install
systemd-boot comes with systemd already, so no additional packages need to be installedinstalled.
ATTENTION: This will install systemd-boot to either of the well-known ESP locations, e.g. /efi, /boot, or /boot/efi. If your ESP is located somewhere else pass the localtion with the --esp-path parameter.
bootctl install
Configure
ATTENTION: In this example the ESP is mounted at /boot. Change accordingly!
Loader
Configuration for the loader itself, located at
/boot/loader/loader.conf.default arch timeout 3 auto-entries 1 auto-firmware 1 console-mode keepBoot entry
Bootloader entry for the main kernel, located at
/boot/loader/entries/arch.conftitle Arch Linux linux /vmlinuz-linux initrd /amd-ucode.img initrd /initramfs-linux.img options root=/dev/mapper/vg0-lv_root rw rootflags=subvol=@ quiet splashamdgpu.dpm=0Fallback
Bootloader entry for the fallback kernel, located at
/boot/loader/entries/arch-fallback.conftitle Arch Linux (fallback initramfs) linux /vmlinuz-linux initrd /amd-ucode.img initrd /initramfs-linux-fallback.img options root=/dev/mapper/vg0-lv_root rw rootflags=subvol=root quiet splashamdgpu.dpm=0rEFInd
Install
pacman -S refind refind-installConfigure
/boot/refind_linux.conf "Boot using default options" "root=/dev/mapper/vg0-lv_root rw rootflags=subvol=@ amdgpu.dpm=0 add_efi_memmap initrd=amd-ucode.img initrd=initramfs-%v.img" "Boot using fallback initramfs" "root=/dev/mapper/vg0-lv_root rw rootflags=subvol=@ amdgpu.dpm=0 add_efi_memmap initrd=amd-ucode.img initrd=initramfs-%v-fallback.img" "Boot to terminal" "root=/dev/mapper/vg0-lv_root rw rootflags=subvol=@ amdgpu.dpm=0 add_efi_memmap initrd=amd-ucode.img initrd=initramfs-%v.img systemd.unit=multi-user.target"EFISTUB
Install
pacman -S efibootmgrConfigure
WARNING:
efibootmgrcan only be run asroot!
efibootmgrcannot overwrite existing boot entries and will disregard the creation of a boot entry if one with the same label already exists. If this is the case, delete the boot entry you want to replace first by listing current boot entries withefibootmgrand then delete the boot entry with
efibootmgr -Bb XXXX # Your corresponding bootnumTo create a new entry
efibootmgrneeds to know the disk and partition where your bootloader resides. This is typically the ESP (EFI System Partition).In this example the ESP is the first partition of
/dev/nvme0n1. Kernel parameters are part of the--unicodeargument. The root partition needs to be passed as a persistent block device name (further reading: Arch Wiki: Persistent block device naming). You can get the persistent block device name with theblkidcommand, i.e. to get the UUID of the second partition on/dev/nvme0n1:blkid -s UUID -o value /dev/nvme0n1p2You can also supply a different identifier like
PARTUUID.NOTE: If you use LVM, you can supply device mapper paths as these already are persistent.
For ease of scriptability, save the values to environment variables:
ASSUMPTIONS: rootfs is on
/dev/nvme0n1, there is a swap partition, and the file system is btrfs.export ROOT=$(blkid -s UUID -o value /dev/nvme0n1p2) export SWAP=$(blkid -s UUID -o value /dev/nvme0n1p3) export CMDL=$(echo 'root=UUID='$ROOT' resume=UUID='$SWAP' rw quiet splash rootflags=subvol=@ add_efi_memmap initrd=\\amd-ucode.img initrd=\\initramfs-linux.img')Then create the boot
entry:entry to load the kernel directly:efibootmgr --create --label "Arch Linux" --disk /dev/nvme0n1 --part 1 --loader /vmlinuz-linux --unicode $CMDL --verboseWhen using a unified kernel image create the boot entry like this:
efibootmgr --create --label "Arch Linux" --disk /dev/nvme0n1 --part 1 --loader "EFI\Arch\linux-signed.efi" --verboseGRUB2
Install
Install GRUB for either target
x86_64-efiori386-pc. Install to a drive, not a partition!pacman -S grub grub-install --target=x86_64-efi /dev/nvme0n1Configure
Edit
/etc/default/grubwith desired options and rungrub-mkconfig -o /boot/grub/grub.cfg