UEFI problems dualboot

Hi folks,

Unfortunately my harddisk died. I have no backup since it was "just" the system without important stuff. However, now I am struggling to setup the system. I had a dual-boot system Linux/FreeBSD where I installed refind in Linux, so via efibootmgr I could choose via ssh in which system I would reboot.

I have now setup Debian and installed refind, I am also coming to the loader prompt. But now I cannot boot, my system gets stuck at exactly the same point as in this thread. (Intel system with nvidia graphics card here) I did not have that problem the last time I installed it, but I cannot remember at best will what I did or how I set it up exactly.

fdisk under Linux gives me:

Code:
Disk /dev/sdc: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 840
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FDC2B10A-1F81-11EB-8810-F46D0497F935

Device        Start       End  Sectors  Size Type
/dev/sdc1      2048    499711   497664  243M EFI System
/dev/sdc2    499712   4405247  3905536  1.9G Linux filesystem
/dev/sdc3   4405248  66906111 62500864 29.8G Linux filesystem
/dev/sdc4        40      1063     1024  512K FreeBSD boot
/dev/sdc5  66906112  75294719  8388608    4G FreeBSD swap
/dev/sdc6  75294720 159180799 83886080   40G FreeBSD ZFS

I don't think I did, but maybe I have used an old partition table(?), I can't remember. Do you have any ideas? Any help appreciated!
 
interestingly, I managed to boot the system now ONCE, but then I got the famous zfs import error on boot. I cannot boot the USB stick via UEFI neither, the system hangs after the EFI framebuffer information, at the same point when booting my system from disk. Booting via the device and not UEFI works (machdep.bootmethod gives BIOS).

I have now found a different way to achieve what I want: I am now booting to refind, which defaults to booting to grub of the Linux system. In FreeBSD I use fusefs-lkl to mount the /boot partition of Linux (ext4 partition) so I can edit the grub.conf file and (de)activate the FreeBSD entry before rebooting. Also interesting, booting via grub delivers a machdep.bootmethod = UEFI in FreeBSD.

It is strange that I could not manage to get it to run with refind, it would have been the saner solution. If someone still has some ideas, please go ahead.
 
It is strange that I could not manage to get it to run with refind, it would have been the saner solution. If someone still has some ideas, please go ahead.
Have you tried copying /boot/loader.efi to your ESP and using that to boot FreeBSD from refind instead of /boot/boot1.efi?
You can actually have multiple files, refind should automatically find and display those, so you can try one or the other. I keep the FreeBSD loader(s) under /EFI/FreeBSD/ but that's not a requirement I guess.
 
You want efibootmgr(8) to check if your boot order is correct, and to set up a boot entry for FreeBSD if one is missing. If the FreeBSD boot loader is in the correct place, rEFInd will find it even without a boot entry.
One thing to look out for: in the past FreeBSD install created another (a new one) EFI partition in addition to the one existing on the storage device already. This can mess with UEFI firmware in the machine. If that is the situation, manually copy the FreeBSD boot loader to a directory EFI/FreeBSD on the correct EFI partition. Then you can remove the not needed EFI partition.
 
Thanks for your input. I have tried loader.efi as well as different other *.efi files, I even copied the one from my notebook where it is working. I found some bugreports regarding mainboard issues, so I updated the firmware. If I did not knew it worked before I would have already given up, it is quite annoying I cannot remember what I did (and I did not spend a lot of time last time I installed it, it just worked, thats why I did not bother to write any documentation, *aaarrrrgh*).

The grub solution I mentioned before does not work since there are several disks in this system and depending on how fast they are spinning up they get different numbers, e.g. hd2, gpt1 does not find the EFI partition. So I have to go for an UEFI/refind setup.

It is weird that I cannot even start the FreeBSD installation via UEFI, it just hangs at the point after the EFI framebuffer information.
 
It is weird that I cannot even start the FreeBSD installation via UEFI, it just hangs at the point after the EFI framebuffer information.
So refind starts up and finds the FreeBSD boot loader, but when you select it, the boot process hangs after displaying that framebuffer information? And the same thing happens when you boot a FreeBSD memstick in UEFI mode without using refind at all? That doesnt sound like the problem is with refind at all, more like some issue with the FreeBSD boot loader and UEFI graphics modes. What model of nvidia graphics card is in this system?

I remember that when I installed refind, I had some struggle to get the desired resolution throughout the boot process, which was tricky as /boot/boot1.efi changed the resolution set up by refind, whereas /boot/loader.efi did not, but I did not experience any hangs. Also there is the setting hw.vga.textmode=1 which can be set in /boot/loader.conf to remain in text mode instead of switching to graphics mode, that had some influence. And finally refind also provides some options to switch graphics and text modes, that can be set in refind.conf.

My refind configuration to boot FreeBSD and Windows 10 currently looks like this:
Code:
# Configuration file for the rEFInd boot menu

timeout 23
use_nvram false

banner banners/PoE-Strand.png

# GOP text mode: 0 = 80x25 / 1 = 80x50 / 2 = 100x31 / 3 = 240x56

textmode 3

# GOP graphics mode: 0 = 1920x1080

resolution 0

use_graphics_for windows
scanfor internal,external,optical
dont_scan_dirs +,ESP:/EFI/Boot
scan_all_linux_kernels false
default_selection 2

Nothing fancy in /boot/loader.conf:
Code:
# CPU Microcode update.
cpu_microcode_load="YES"
cpu_microcode_name="/boot/firmware/intel-ucode.bin"

# Set boot max graphics resolution.
efi_max_resolution="1080p"

# Set beastie logo.
loader_logo="beastie"

# ZFS support.
zfs_load="YES"
 
thank you all for your suggestions. I have finally given up on that damn thing. I guess I am hit by this bug: PR 209821 I have now tried various FreeBSD versions since I cannot remember when I initially installed my system when it worked. However, I have wasted hours now which is too much for "just getting the system to run", it's quite embarrassing.
 
Back
Top