Solved how to avoid ZFS at boot?

I compiled a kernel a new kernel but on the /etc/make.conf I set up this options:

Code:
MODULES_OVERRIDE=zfs opensolaris vmm

The idea was to avoid compiling extra modules and just compile zfs and use it when required but not to load it all the time.

Every time I reboot the machine zfs is loaded, therefore I would like to know if there is a way to avoid loading the zfs module when booting.
 
You may have a line in your /boot/loader.conf that says:
Code:
zfs_load="YES"
or a line in your /etc/rc.conf that says:
Code:
zfs_enable="YES"
Either of these would cause the ZFS module to be loaded. The make.conf(5) option you set determines what is compiled, but doesn't influence what is loaded at run-time.
 
Problem is that I don't have any of does, in fact I am trying:
Code:
zfs_load="NO"
or
Code:
zfs_enable="NO"
without luck
 
That is likely your issue. It may be that the startup scripts check whether a variable is set rather than checking its actual value. So the line in /etc/rc.conf is probably causing the ZFS module to be loaded, since the variable is set. My caveat is that I haven't opened up the script (in /etc/rc.d) to check.

Try commenting out both those lines, restarting then running kldstat.
 
By default and in theory zfs should not be loaded, I just add zfs_* to see it could help, after restarting this is always the output of kldstat:

Code:
> kldstat
Id Refs Address            Size     Name
1   10 0xffffffff80200000 c50b70   kernel
2    1 0xffffffff81011000 16fa2e   zfs.ko
3    1 0xffffffff81181000 3962     opensolaris.ko

anyway defaults/rc.conf and defaults/loader.conf they set
Code:
zfs_enable="NO"
Code:
zfs_load="NO"
respectively

I would like to avoid doing:
Code:
kldunload zfs
in /etc/rc.local
 
Can you see when the ZFS module is being loaded? Before the root filesystem is mounted ( dmesg | grep zfs)? Or after? It might be that something else is calling zpool(8) or zfs(8), which will cause the ZFS module to be loaded. For example, I've seen that using sysutils/py-salt does that.
 
I just disable salt:
salt_minion_enable="NO" and notice that ZFS module it not loaded any more, any idea of how to avoid this ?
 
You should make up your mind whether you ever want to run ZFS on a system or not.

To completely ban ZFS set this in /etc/src.conf:
Code:
WITHOUT_ZFS=yes
and rebuild your custom kernel after cleaning the changes you made to /etc/make.conf regarding this problem.

If you want to use ZFS occasionally kldload zfs manually is sufficient, but your kernel needs to have ZFS compiled. In this case you certainly do not want a ZFS where the set of modules ZFS requires was messed with.

Nothing prevents you from having two kernels ready to use. I.e one custom kernel without ZFS and another one that has ZFS (like GENERIC). You can easily reboot into an alternative kernel when there is a need to do so.
 
Back
Top