OPNsense Forum

English Forums => Tutorials and FAQs => Topic started by: fcmircea on November 17, 2023, 11:20:13 am

Title: Installation across multiple disks
Post by: fcmircea on November 17, 2023, 11:20:13 am
Hello,

I'm looking to install OPNSense on a HP Microserver Gen8 on an SSD attached to the ODD port.

This particular set-up has a boot controller that does not allow direct boot from the SSD on the ODD port if there are disks present in the 4 disk bays.

It also has an internal SD card that can be used for booting, and I used to have an Ubuntu installation that had the /boot partition and bootloader on the SD card and the /root partition on the SDD.

I could set this up at installation.

I am looking to replicate this set-up, but the OPNSense installer doesn't seem to support this directly, since if I create partitions manually (eg: "freebsd-boot" on the SD card and "freebsd-ufs" on the SDD), the system will return a "ufs partition not found" message.

So what should I do at partition time so that the bootloader and anything else needed ends on the SD card, while the main part of the installation ends up on the SDD?

Thanks!

Details on HP forums here: https://community.hpe.com/t5/operating-system-linux/hp-proliant-microserver-gen8-g1610t-boot-from-ssd-odd/td-p/6704677
Title: Re: Installation across multiple disks
Post by: Patrick M. Hausen on November 17, 2023, 11:30:20 am
You can perform a manual installation of FreeBSD 13.2 and then use the bootstrap method to turn that into an OPNsense.

https://github.com/opnsense/update

I recommend using ZFS instead of UFS.

Title: Re: Installation across multiple disks
Post by: fcmircea on November 17, 2023, 11:46:57 am
I will give that a go.

Is it worth using ZFS even if it's just one disk?
Title: Re: Installation across multiple disks
Post by: Patrick M. Hausen on November 17, 2023, 11:49:20 am
Yes. Much more resilient to e.g. power failure.
Title: Re: Installation across multiple disks
Post by: fcmircea on November 17, 2023, 12:01:28 pm
So I've tried to install FreeBSD 13.2:
- manually placing freebsd-boot of 512K on disk 1
- manually placing freebsd-ufs of 42GB on disk 2
- manually placing freebsd-swap of 8GB on disk 2

After the instalation:
- if i boot from disk 1, I get the folliowing msg: "gptboot: no UFS parititon was found"
- if I boot from disk 2 "missing bootloader"

What would be the next steps?

Thanks
Title: Re: Installation across multiple disks
Post by: Patrick M. Hausen on November 17, 2023, 12:05:57 pm
Can this system boot EFI? Possibly a complete EFI install on disk 2 plus rEFInd boot manager on disk 1 will do the trick.
Title: Re: Installation across multiple disks
Post by: fcmircea on November 20, 2023, 12:56:58 am
I've used ubuntu live to install grub on the SD card and then added an entry to boot from the ssd (having previously installed opnsense on the SSD).





Title: Re: Installation across multiple disks
Post by: Maurice on November 20, 2023, 05:22:35 pm
For future reference: This doesn't require third-party tools and can be done with the OPNsense installer.

For UEFI:
- create an efi partition on the bootable disk (da0)
- create a freebsd-ufs root partition on the secondary disk (da1)
- complete the OPNsense installation, but abort the reboot
- mount the efi partition: mount_msdosfs /dev/da0p1 /boot/efi
- set the root partition: echo "currdev=disk1p1:" > /boot/efi/efi/freebsd/loader.env
- reboot

For legacy BIOS (with GPT disks):
- create a freebsd-boot and a freebsd-ufs partition on the bootable disk (da0)
- create a freebsd-ufs root partition on the secondary disk (da1)
- complete the OPNsense installation, but abort the reboot
- mount the freebsd-ufs partition on the bootable disk: mount /dev/da0p2 /boot/efi
- set the root partition: echo "1:ad(1p1)/boot/loader" > /boot/efi/boot.config
- reboot

Cheers
Maurice