Hello to the BSD community,
I am new to NetBSD, and BSD in general, I've been a long time Linux user, it's been a while I wanted to discover the BSD world, I am at least putting time on it.
After a first trial install, I am setting up a multi-boot disk based on GPT scheme with hybrid MBR/EFI boot (I know, I don't make it easy...).
Beyond that, I wanted to setup CGD, so I eventually installed everything by hand following these guides (I learned a lot going through this, I could not setup LVM on the CGD within the installer, I guessed it was not supported but I can report what blocked me if it helps to have feedback) :
Now, I need to boot it, and I can't make it work, so I come for help.
I think what I have to aim to, is to have Grub chainload the CGD boot root disk, but I am stuck.
Let's say I have these partitions (I have more because there are other systems, but that's the subset we need here):
- dk0 : EFI ESP (I am only interested in BIOS boot for now, but it is there in the setup)
- dk1 : ext4, Alpine Linux with Grub configuration
- dk2 : FFSv2, NetBSD boot root according to https://wiki.netbsd.org/security/cgdroot/
- dk3 : CGD with LVM bootstrapped manually as in the above-mentioned guide
- dk127 : BIOS Boot Partition for GPT/MBR hybrid mode
On "dk1", this is where I setup Grub, for the NetBSD entry, I have :
set root=(hd0,gpt3)
chainloader +1
So, I expect it to chainload the NetBSD secondary boot loader /usr/mdec/boot
on /dev/dk2
that will load the boot.cfg
file and setup the CGD for booting on root partition /dev/dk3
.
From the NetBSD installer shell, I ran this command :
installboot -v -t ffs /dev/dk2 /usr/mdec/bootxx_ffsv2
And, the moment of truth, after selecting NetBSD from Grub, I get the message :
Error no slice
Before running installboot
, I had an error like "bad signature", so it indeeds seems to find the installed bootxx_ffsv2
primary boot loader.
I suspected it was looking for a disklabel, however, I have read that on GPT label, NetBSD does not need to setup a disklabel, it can address GPT partitions. But maybe not the bootloader...
So, I tried to run gpt biosboot -c /usr/mdec/gptmbr.bin -i 3 wd0
, which led to this message :
gpt: /dev/rwd0: No bootable partition
I don't know what this message exactly means, which partition should be bootable, and how should I make it bootable... In my case, the BIOS boots on the BIOS boot partition, which starts Grub with configuration on /dev/dk1
, and I am not even sure that my chainloader tries to boot the gptmbr.bin
, I guess it directly goes to bootxx_ffsv2
. But I am quite unsure what happens really, and I wonder if the Grub chainloader is not supposed to do the job of the gptmbr.bin
. In any case, I don't know what I have to do to avoid the "Error no slice" message, and to be able to boot the /usr/mdec/boot
copy present on dev/dk3
. After that, I guess that it will boot correctly the CGD drive if the boot root disk is setup correctly.
I would be grateful if someone would know what to do from there 🙂
Lastly, note that it boots the kernel on /dev/dk2
if I setup Grub with knetbsd /netbsd.gz
but hangs, which is expected because the boot.cfg
with the CGD setup is not read. That's why I feel I have to go through the chainloader (I am not sure Grub can pass the options, and this would also allows the CGD setup to be entirely done on the NetBSD part).