# ZFS Root install with DELL R540 and H330



## i.am.the.problem (Dec 23, 2020)

Hi,

I'm trying to install FreeBSD 12.2, Root on ZFS, on a DELL R540 with a H330 raid card.

I've switched the H330 to HBA mode.

I've tried booting into the installer and try to select the Auto (ZFS) - Guided Root-on-ZFS but got a kernel panic.

I setup a VM which the same number of disks, did the install in there and saved the /tmp/bsdinstall_log.

I used this file to get the commands needed to do the setup manually.

I then booted into the installer, set the keyboard and hostname then exited to the shell and ran the following commands:

kldload mfip
gpart create -s gpt "mfisyspd0"
gpart add -a 4k -l gptboot0 -t freebsd-boot -s 512k "mfisyspd0"
gpart bootcode -b "/boot/pmbr" -p "/boot/gptzfsboot" -i 1 "mfisyspd0"
gpart add -a 1m -l swap0 -t freebsd-swap -s 2147483648b "mfisyspd0"

On running the last command it kernel panicked again.






How can I proceed?


----------



## SirDice (Dec 23, 2020)

Try to switch to the mrsas(4) driver instead of mfi(4).


```
Using /boot/device.hints (as mentioned below), the	user can provide a
     preference	for the	mrsas driver to	detect a MR-Fusion card	instead	of the
     mfi(4) driver.

	   hw.mfi.mrsas_enable="1"
```


----------



## i.am.the.problem (Dec 23, 2020)

Hi, It tells me that mrsas.ks is already loaded in the kernel.


----------



## SirDice (Dec 23, 2020)

Yes, and so is mfi(4). But the mfi(4) driver takes precedence. That's why you have to set `hw.mfi.mrsas_enable` _before_ the kernel loads.


----------



## i.am.the.problem (Dec 23, 2020)

Ah OK. So I need to alter the install image that I'm booting from to have hw.mfi.mrsas_enable="1" in the /boot/device.hints?


----------



## SirDice (Dec 23, 2020)

Or drop to the loader(8) prompt and use the `set` command to set it. 


```
set variable
     set variable=value
             Set loader's environment variables.
```
See loader(8). 

You do want to set this in /boot/device.hints of the installed machine (at the end of the install you get a chance to make some final adjustments, that's the right time to fix it).


----------



## i.am.the.problem (Dec 23, 2020)

Got it up and running. 

Once I'd set the driver from the loader I was able to use the Auto (ZFS) - Guided Root-on-ZFS to do the install.

Thank you for your help.


----------

