Joel Sing <[email protected]> writes: > On Friday 06 January 2017 15:23:32 Timo Myyrä wrote: > >> Here's the output of installboot on running system: >> $ doas installboot -v sd1 >> Using / as root >> installing bootstrap on /dev/rsd1c >> using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot >> sd1: softraid volume with 1 disk(s) >> sd1: installing boot loader on softraid volume >> /usr/mdec/boot is 6 blocks x 16384 bytes >> sd0a: installing boot blocks on /dev/rsd0c, part offset 1104 >> master boot record (MBR) at sector 0 >> partition 0: type 0xEF offset 64 size 960 >> partition 3: type 0xA6 offset 1024 size 1000205876 >> /usr/mdec/biosboot will be written at sector 1024 >> >> and heres from bsd.rd shell: >> Using /mnt as root >> installing bootstrap on /dev/rsd1c >> using first-stage /mnt/usr/mdec/biosboot, second-stage /mnt/usr/mdec/boot >> sd1: softraid volume with 1 disk(s) >> sd1: installing boot loader on softraid volume >> /mnt/usr/mdec/boot is 6 blocks x 16384 bytes >> sd0a: installing boot blocks on /dev/rsd0c, part offset 1104 >> master boot record (MBR) at sector 0 >> partition 0: type 0xEF offset 64 size 960 >> partition 3: type 0xA6 offset 1024 size 1000205876 >> /mnt/usr/mdec/biosboot will be written at sector 1024 >> >> Looking at the output it seems to just copy the regular boot files and > skips >> processing EFI stuff. And as the system boots with EFI it uses the old >> bootloader and hence the problems with opening the crypto volume. > > Correct - it is installing the MBR/PBR boot block and boot loader, rather than > the EFI one. > >> Should there be check to see if the booted device has i partition with efi >> folder and copy the EFI bootloader in that case? > > The code in question is the findgptefisys() function in > src/usr.sbin/installboot/i386_installboot.c. It is likely that there is > something up with your disk configuration (missing protective MBR, incorrect > GPT header, incorrect GPT signature, corrupt checksum, etc) that is making it > think that this is an MBR system, rather than a GPT one. That said, it is also > possible that it is a bug/corner case... > > If you're able to sprinkle some printf's through that function and determine > what check is failing, it would help narrow down the issue. You probably also > want to check the MBR and GPT to see what is actually on the disk. >
Yeah, printfs and (also running fdisk) showed that I was missing the protective MBR. Shortly after I also learned that this is not fixed by running "fdisk -ig sd0" on a running system... At least I did backups before running it. After reinstalling I don't have the issue anymore. Timo

