Solved Another Way To Boot (Crypted) Zroot

Hello people,

I ask for your help.

I installed FreeBSD13 on 2 mirrored Disks that are attached to a consumer HBA.

After reboot, the system is not able to boot from that HBA, but booting from USB is possible.

I had the idea to use a USB stick as primary boot device that just (somehow) links to the mirrored disks.

But how to do it? Is it possible?
 
You say "booting from USB is possible" so you already have the answer to your question of "is it possible"; at least in part.

Just partition / newfs the disk and add it to /etc/fstab.

What am I missing?
 
You say "booting from USB is possible" so you already have the answer to your question of "is it possible"; at least in part.

Just partition / newfs the disk and add it to /etc/fstab.

What am I missing?
:-/ I believe this is not going to work ... since the bootstick needs at least some boot record
 
Thanks, but I want to use the installed mirrored setup, cuz' installation on usb stick is not redundant.
 
Is the HBA a physically separate card or is it a BIOS implmentation of "RAID-ish" types of things?
Do you absolutely positively need the HBA?

Reason for asking is that my personal experience with the typical HBAs in consumer grade stuff is "not good".
Disable/remove if possible.
Downside, you may wind up reinstalling.
Upside: you've removed a layer that can cause you problems and simplified everything.
 
Is the HBA a physically separate card or is it a BIOS implmentation of "RAID-ish" types of things?
Do you absolutely positively need the HBA?

Reason for asking is that my personal experience with the typical HBAs in consumer grade stuff is "not good".
Disable/remove if possible.
Downside, you may wind up reinstalling.
Upside: you've removed a layer that can cause you problems and simplified everything.
The HBA is a PCIe card and I would rather like to keep it.
 
There are two things needed to boot. Your HBA must supply a BIOS somewhere above 0xC000:0 or add a UEFI plugin to allow the firmware to see the disk. If the firmware can see the logical unit and the logical unit is in the boot order, there must be a boot block.

Does your HBA provide a BIOS or UEFI plugin? If yes, do you have boot blocks?

For example, back in the day my Adaptec SCSI card put its own BIOS at 0xC000:8000. The system BIOS would scan the option ROM BIOS range for identifiable ROMs, and if found branch to that location. The option ROM would initialize any disks and add them to the list of disks the BIOS sees, i.e. a D: disk. Option ROMs are the magic that make add-on cards boot.
 
Then the only way you can "boot" from those devices is use a small USB stick to boot from them. At $JOB our hardware does not see SAN devices connected to Emulux HBA as bootable either. We must boot from local disk. (We disable UEFI and boot in legacy mode too.)
 
Hello people,

I ask for your help.

I installed FreeBSD13 on 2 mirrored Disks that are attached to a consumer HBA.

After reboot, the system is not able to boot from that HBA, but booting from USB is possible.

I had the idea to use a USB stick as primary boot device that just (somehow) links to the mirrored disks.

But how to do it? Is it possible?
I have found a solution!
 
Is it somehow possible to put the bootloader on the usbstick and tell him to boot the zroot pool from the other zfs mirrored disks? I booted live system and it tells me the mirrored disks are da0 and da1, so they will be detected.
 
Is it somehow possible to put the bootloader on the usbstick and tell him to boot the zroot pool from the other zfs mirrored disks? I booted live system and it tells me the mirrored disks are da0 and da1, so they will be detected.
I guess at least the kernel must be placed on the usbstick to be loaded, right?
 
I guess at least the kernel must be placed on the usbstick to be loaded, right?
I've not tried this, but if you look at the booting bits, at some point there is a "mount root from" (not sure of the exact name). Kind of like a GELI encrypted volume, you have an unencrypted /boot, loader gets to that, then you decrypt and mount root from another partition. What you want is similar.

Now, before you ask me "How do I do that": I don't know. I'm out of ideas/answers.
 
That may work. I personally have no knowledge/experience doing this, so I am operating in "theory world". If you let this percolate/sit a bit, maybe someone with hands on knowledge can help.
I think your answer in #9 is key.

I'm going to bow out now (i'll look on in interest) and hope you get your answer.
 
I've not tried this, but if you look at the booting bits, at some point there is a "mount root from" (not sure of the exact name). Kind of like a GELI encrypted volume, you have an unencrypted /boot, loader gets to that, then you decrypt and mount root from another partition. What you want is similar.

Now, before you ask me "How do I do that": I don't know. I'm out of ideas/answers.
how to do it?! But this is not going to work since the kernel must be loaded to find the HBA.
 
I have done it! But before releasing solution I have to tune some things to make it work properly.
 
The complete HowTo. Made - thanks to you!

LOL -> (Awaiting approval before being displayed publicly.) 😁 Please, wait ... until review is finished.
 
Any suggestions?

Here is the HowTo (review takes too long):

Assuming you have FreeBSD on a mirrored disk setup, da0 da1.
Your new boot disk might be ada0.

Use live system after FreeBSD installation (bsdinstall) or just boot some live system.

Switch to root.

Enter the commands to set up the new boot disk:

fdisk -BI /dev/ada0
bsdlabel -B -w ada0s1
newfs -U -O1 /dev/ada0s1a

Install boot loader:
boot0cfg -v -B -t1 ada0

Mount your installation (if it is not already mounted) and mount your new boot disk:
mount /dev/ada0s1a /mnt

Assuming that your installation is mounted to /live copy the boot directory on the new boot disk:
cp -r /live/boot /mnt

Make your kernel mount your pool that is on da0 and da1:
echo 'vfs.root.mountfrom="zfs:zroot:/ROOT/default"' >> /mnt/boot/loader.conf

umount /mnt

Do not forget to switch to your new boot device in your BIOS after reboot.
 
Back
Top