Configure Boot Loader
We will be using systemd-boot
as the boot loader. See https://wiki.archlinux.org/title/Arch_boot_process#Boot_loader for all options.
This page is partially adopted from https://wiki.archlinux.org/title/Systemd-boot
Install Boot Loader
First ensure the system is in UEFI mode with
ls /sys/firmware/efi/efivars
ls /sys/firmware/efi/efivars
The command should not error.
Assuming you have been following this guide, the ESP mount point should be /boot
(chrooted into the system i.e. /mnt
)
Install the boot loader with
bootctl install
bootctl install
TIP
This will automatically search for /efi
. /boot
and /boot/efi
. If you are using a different mount point, you need to set --esp-path=/path/to/esp
Configure Loader
Create /boot/loader/loader.conf
with
nvim /boot/loader/loader.conf
nvim /boot/loader/loader.conf
Paste in the following content
default arch.conf
timeout 3
console-mode max
editor yes
default arch.conf
timeout 3
console-mode max
editor yes
WARNING
Use space for indent. Tabs won't work.
TIP
We have editor yes
in case something goes wrong, we can edit the boot loader
TIP
Change timeout 3
to a longer timeout if you need longer to select in the boot menu
Save with the following so parent directories are created if they don't exist
:w ++p
:w ++p
Next run the following to get the UUID of the root partition. Copy it somewhere and we will need it later.
blkid /dev/sda3
blkid /dev/sda3
Next we will add 2 loader entries for arch
and arch-lts
.
arch
Create /boot/loader/entries/arch.conf
nvim /boot/loader/loader.conf
nvim /boot/loader/loader.conf
Paste in the following content. Replace the UUID with the one you got from blkid
title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options root="UUID=d71c6c2a-2731-4825-b4c6-e25ab1fd451b" rw
title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options root="UUID=d71c6c2a-2731-4825-b4c6-e25ab1fd451b" rw
WARNING
Replace amd-ucode
with intel-ucode
if you have intel CPU
arch-lts
Run this to clone the arch
entry to arch-lts
cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-lts.conf
cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-lts.conf
Edit /boot/loader/entries/arch-lts.conf
and replace:
Arch Linux
withArch Linux LTS
/vmlinuz-linux
with/vmlinuz-linux-lts
/initramfs-linux.img
with/initramfs-linux-lts.img
WARNING
Check you have intel-ucode
instead of amd-ucode
if you have intel CPU
It should look like this
title Arch Linux LTS
linux /vmlinuz-linux-lts
initrd /amd-ucode.img
initrd /initramfs-linux-lts.img
options root="UUID=d71c6c2a-2731-4825-b4c6-e25ab1fd451b" rw
title Arch Linux LTS
linux /vmlinuz-linux-lts
initrd /amd-ucode.img
initrd /initramfs-linux-lts.img
options root="UUID=d71c6c2a-2731-4825-b4c6-e25ab1fd451b" rw
Reboot
Exit the chroot environment by pressing Ctrl+D
or running
exit
exit
Then unmount all partitions
umount -R /mnt
umount -R /mnt
Exit the SSH environment by pressing Ctrl+D
or running
logout
logout
Now, go to Hyper-V Manager:
- Click on
Shut Down...
to shut down the VM. - Open
Settings...
and selectDVD Drive
underSCSI Controller
. - Click
Remove
on the right to remove the installation ISO - Click
OK
to save the settings. - Press
Start
to start the VM. Then pressConnect...
to connect to the VM.
In the login screen, type root
for the login, then type the root password you just set (not the one you set intiaially for the live environment).
You should see the prompt if you login successfully. pistonite
would be your hostname.
[root@pistonite ~]#
[root@pistonite ~]#
Boot LTS
We will now make sure the LTS kernel can also boot.
- Go to Hyper-V Manager and click
Shut Down...
to shut down the VM.
TIP
You don't need to close the VM connection, we will be reusing it.
- Click
Start
in the VM connection window. Press down in the boot menu to prevent the default boot. - Select
Arch Linux LTS
and pressEnter
to boot.
You should be able to login the same way as above.
Disable Editing
Now that we have confirmed both kernels can boot, we will disable editing the boot loader.
Run
nvim /boot/loader/loader.conf
nvim /boot/loader/loader.conf
and change editor yes
to editor no
.