You are not logged in.

#1 2022-07-15 10:44:57

jimmyg
Member
Registered: 2022-06-14
Posts: 41

[SOLVED] rEFInd and changing esp mount point

EDIT: worked it out. solved.

Hi

Im looking for some clarification really on some changes I'd like to make to my current configuration with the rEFInd boot manager. This is because I'm using btrfs and I would like to include my kernels and initramfs.img files in my snapshots.

My searching led me to this page. Of course I would need to adopt it for use with rEFInd and, I would not use encryption.

I currently have a FAT32 EFI partition /dev/nvme0n1p1 mounted to /boot. When I first installed rEFInd it found my kernels and created a refind_linux.conf file in /boot with my kernels

"Boot with standard options"  "root=PARTUUID=6df48d55-daa4-4da7-b838-730bb7ccbb6e rw rootflags=subvol=root add_efi_memmap initrd=intel-ucode.img initrd=initramfs-%v.img quiet loglevel=3"
"Boot using fallback initramfs"  "root=PARTUUID=6df48d55-daa4-4da7-b838-730bb7ccbb6e rw rootflags=subvol=root add_efi_memmap initrd=intel-ucode.img initrd=initramfs-%v-fallback.img quiet loglevel=3"
"Boot to terminal"               "root=PARTUUID=6df48d55-daa4-4da7-b838-730bb7ccbb6e rw add_efi_memmap initrd=intel-ucode.img initrd=initramfs-%v.img systemd.unit=multi-user.target"

So, the steps to achieve this as I understand them, and as described in the link I provided, would be:

1 - Edit /etc/fstab to change the mount point for ESP to /efi

2 - then unmount /boot, create /efi and mount it

3 - then reinstall the kernel packages and intel-ucode package with pacman so they are in /boot

4 - run sudo mkinitcpio -P to create new initramfs.img in /boot

At this point I think I would need to regenerate refind_linux.conf file in /boot (or copy the current one from /efi to /boot and edit it) to get the right paths for the initrd entries, I think mkrlconf script as root can do this. Getting the initrd= paths correct is one of the things I wanted to check.

As I would now mount my ESP to /efi the initrd= paths will need to change. The Arch wiki says the paths must be relative to the root of the file system where the kernels reside. So my new refind_linux.conf file would look like this?:

"Boot with standard options"  "root=PARTUUID=6df48d55-daa4-4da7-b838-730bb7ccbb6e rw rootflags=subvol=root add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\initramfs-%v.img quiet loglevel=3"
"Boot using fallback initramfs"  "root=PARTUUID=6df48d55-daa4-4da7-b838-730bb7ccbb6e rw rootflags=subvol=root add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\initramfs-%v-fallback.img quiet loglevel=3"
"Boot to terminal"               "root=PARTUUID=6df48d55-daa4-4da7-b838-730bb7ccbb6e rw add_efi_memmap initrd=boot\intel-ucode.img initrd=boot\initramfs-%v.img systemd.unit=multi-user.target"

The other thing I wondered about is about whether or not the UEFI boot manager entry would need to be updated. So currently, efibootmgr command shows:

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0001,0002,0003,0004
Boot0000* rEFInd Boot Manager	HD(1,GPT,7f9164ff-7ef8-4003-b535-eb1c15a7daf8,0x800,0x100000)/File(\EFI\refind\refind_x64.efi)

The PARTUUID is the same of course, but the file path might need to be corrected to reflect my new changes? I'm unclear about this actually. I know 'how' to change/update it, just not sure if I'd need to.

I believe rEFInd is fine with btrfs file system if a) the correct drivers are made available in esp/EFI/refind/drivers_x64 and b) the partition is unencrypted which mine is not. I have copied the driver for btrfs from  /usr/share/refind/drivers_x64/ to where it needs to be already. The table of comparison for bootloaders on this wiki page I read said that.

I might have just over complicated this in my head but rather than just go ahead and change things and end up with an unbootable system, I wondered if anyone here might be able to confirm if the steps above would be the correct way to do it.

best wishes, jimmy

Last edited by jimmyg (2022-07-16 00:23:58)

Offline

Board footer

Powered by FluxBB