How to install FreeBSD 14-2 on a dedicated server with ZFS mirror?
... / How to install FreeBSD 14...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

How to install FreeBSD 14-2 on a dedicated server with ZFS mirror?

by
Nicolas Lallouet
Created on 2025-04-03 15:26:13 in Eco Dedicated Servers

Hi,

 

I have a dedicated server (Kimsufi KS-LE-2), with 2 disks.

I would like to setup this server as follow :

1/ Disk structure

A zpool (ZFS) with a mirror using both disks (sda, sdb). This would result in a config looking like this :

config: zpool ONLINE mirror ONLINE sda ONLINE sdb ONLINE

2/ Operating System

I would like to install FreeBSD 14.2 on this server.Questions I have:

  1. How can I mount the FreeBSD Installer image (ISO-IMAGE), and boot on it ?
  2. https://download.freebsd.org/releases/ISO-IMAGES/14.2/FreeBSD-14.2-RELEASE-amd64-mini-memstick.img
  3. If this is possible, the reste will be easy to achieve (shell console to setup my zpool, then follow installer for FreeBSD base installation)
  4. I have read several community topics proposing a solution based on “Bring Your Own Image - byoi”, using a RAW or QCOW2.
    1. I have tried this, but wan never able to boot past the FreeBSD bootloader.
    2.  Looking at the disk structure (from Debian rescue), it show that the RAW image was burned on 1 of the two disks. Imagining I could boot this OS (which I have not been able to), I do not see how I can the change the disk structure to a ZFS Pool with a MIRROR

 

NB : I do not have past experience with RAW and QCOW2 images. I understand that they are pre-installed images. Possibly, I am missing some knowledge on how to prepare them before sending them through “Bring Your Own Image - byoi” process.

Help would be very much appreciated image


3 Replies ( Latest reply on 2025-04-15 15:52:12 by
le_sbraz
)

Hello,

Do you have a KVM on your server? I don't remember if KS-LE have them.
If you do have one, you can try using an iPXE boot script (https://help.ovhcloud.com/csm/en-dedicated-servers-ipxe-scripts?id=kb_article_view&sysparm_article=KB0058505)

netboot.xyz provides an installer for FreeBSD: https://github.com/netbootxyz/netboot.xyz/blob/master/roles/netbootxyz/templates/menu/freebsd.ipxe.j2

 

You can load up their installer menu with the following script:


#!ipxe
chain --autofree https://boot.netboot.xyz

 

 

If you don't have a KVM, it's probably a bit trickier. FreeBSD provides QCOW2/RAW images that you could use with BYOI but I don't think they use ZFS and BYOI, by design, only installs to the first disk of the server.

Hi @le_sbraz 

(Sorry for the delay. There was a bug on OVH Community and my account. I was unable to reply.)

 

Thanks for the hint on netboot.xyz. I tried that, but FreeBSD is currently not available. To be more explicit, the “BSD Installer” menu is deactivated, and seems to have been for some time now. I brought this up on the Netboot.xyz Discord.

 

First of all : I was using SoL to access my server. That was a poor choice, because it made me think FreeBSD was not booting (boot process hung at beginning). In fact, I think VT change is not compatible with SoL.

==> Now I use KVM (though navigator). That does the trick.

NB : KVM Java webstart is NOT compatible with Macs with Apple Silicon (M1, ...., M4). It seems OVH Support has no clue on this, and just tells me to try Windows or Linux. (Not a solution obviously)

 

I finally got the installation working through another approche : 

  • Boot on OVH's rescue image (Linux)
  • Take advantage that now OpenZFS has been ported to Linux
  • Erase both disks
  • Format each disk with GPT partition table
  • On both disks : Add a EFI Partition and set it up correctly for FreeBSD
  • On both disks : Add a ZFS partition taking up the rest of the disk
  • Create a Zpool, using the two ZFS Partitions In my case a Mirror one.
  • Create ZFS volumes, ready for FreeBSD install.
  • Install manually FreeBSD on the partition
  • Do basic configuration (sshd_enable, zfs_enable, bootload.conf, etc...)
  • Reboot

Then I just had to finish installing my server.

 

Here is a source I used (I didn't exactly follow to the letter, but the main steps are there) : https://community.hetzner.com/tutorials/freebsd-openzfs-via-linux-rescue