Stop ZFS/opensolaris from autoloading?

Vincent Hoffman-Kazlauskas vince at
Thu May 4 13:56:08 UTC 2017

On 01/05/2017 00:17, Dan Mahoney wrote:
> All,

> Short of renaming the modules (which breaks upgrades and is
> unpredictable) is there any easy way to stop a system from auto-loading
> the ZFS modules?
> We've got some memory-constrained systems and the concept of "modules
> that load themselves" somewhat bugs me.

reasonably enough, Howver I think that the only way to do this withouth
deleting/renaming the kernel modules would be to set
kern_securelevel_enable=1   (or greater) in rc.conf or use
sysctl kern.securelevel=1
These are the same thing but adding to rc.conf makes it permement.
Have a read of man 7 security, specifically the
section first though as it does other things you may not want.
Also one you have set a secure mode you are stuck with it till reboot

[root at vm ~]# sysctl kern.securelevel=1
kern.securelevel: -1 -> 1
[root at vm ~]# zpool status
internal error: failed to initialize ZFS library
[root at vm ~]# sysctl kern.securelevel=0
kern.securelevel: 1
sysctl: kern.securelevel=0: Operation not permitted


> I'd rather "zpool status" (which is often called by things like Facter)
> simply return an error than load a kernel module that will never be used.
> -Dan

More information about the freebsd-questions mailing list