SOLVED Blacklist Kernel Module in TrueNAS Scale

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
I am using a Tyan S5510G2NR-LE motherboard with a Xeon E3-1220v2 cpu. This combination has a issue where if the Intel Management Engine Interface kernel module (mei) is loaded it causes some weird behavior. The worst of which is that the system will shutdown when told to reboot. It didn't use to do it when I ran a i3-2100T. Which is probably because that CPU doesnt support any of Intel's remote management stuff. I only figured out what was happening because of a obscure forum post elsewhere. I followed this process when I ran Debian to blacklist. What is the best practice to do this on TrueNAS Scale?

Just unloading the module is not enough. It must be prevented from ever being loaded.
 

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
Blacklisting the module the Debian way worked fine. Got some errors while running the commands but everything seems to be fine.

Still interested in if there is a better way to do this on Truenas since doing it the Debian way probably wont survive a upgrade.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Blacklisting the module the Debian way worked fine. Got some errors while running the commands but everything seems to be fine.

Still interested in if there is a better way to do this on Truenas since doing it the Debian way probably wont survive a upgrade.
How do you do it with debian?

Can it it be done as a post boot script?
 

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
Link to the Debian wiki was buried in my post. These are the steps from it.

Howto:
  1. Create a file '/etc/modprobe.d/<modulename>.conf' containing 'blacklist <modulename>'.
  2. Run 'depmod -ae' as root
  3. Recreate your initrd with 'update-initramfs -u'
 

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
Unfortunately, i dont see a way to do it as a boot script. There probably is a way but i dont know how.
 
Joined
Oct 22, 2019
Messages
3,641
I don't understand why they require the steps of "depmod", and especially requiring you to rebuild the initramfs.

I doubt this specific module is included in the initramfs for TrueNAS SCALE.

What about trying to add a "postinit" script that issues modprobe -r mei ?

This will survive reboots.
 

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
What about trying to add a "postinit" script that issues modprobe -r mei ?

This will survive reboots.
I started with trying a posinit script with that to see if i could get lucky but what that command does is remove a already loaded module. For my problem i have to prevent it from being loaded so it needs to be blacklisted.


It looks like depmod might not be actually needed. another guide.
 
Joined
Oct 22, 2019
Messages
3,641
For my problem i have to prevent it from being loaded so it needs to be blacklisted.
How come, though? It sounds like the module gives you issues for something much later: reboots / shutdowns

If the module is removed postinit, and then you go to issue a reboot, wouldn't the system reboot properly at this point?
 

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
There must be something that remains modified even after the module is unloaded. I've tested it both ways on Debian and on Truenas with the same behavior. MEI is for Intel's out of band management which have the capability to control power moding of the computer. This motherboard just turned 11 years old so my motivation to get to the bottom of it is kinda low.
 
Joined
Oct 22, 2019
Messages
3,641
Rebuilding the initramfs and/or editing the default kernel CMDLINE parameters * for SCALE (an appliance) is not feasible. :frown:

Nor would a script that creates the blacklist, since it would be too late in the bootup process.

The only thing I can think of would be to interrupt the boot process (if SCALE uses a Grub menu), and then manually edit the kernel CMDLINE to include something like modprobe.blacklist=mei

I don't have SCALE to test this out on, nor would it even be practical, since it requires hooking it up to a display every time you reboot the system.

* EDIT: Unless something like this is still safe with SCALE?
midclt call system.advanced.update '{"kernel_extra_options": "firstoption=value secondoption=value thirdoption=value"}'


Modified command from their quote:
midclt call system.advanced.update '{"kernel_extra_options": "modprobe.blacklist=mei"}'
 
Last edited:

radiobrain

Cadet
Joined
Feb 15, 2023
Messages
8
removed the blacklist and rebooted.

ran this command as you suggested... i have two modules to blacklist...

midclt call system.advanced.update '{"kernel_extra_options": "modprobe.blacklist=mei_me modprobe.blacklist=mei"}'

lsmod | grep mei

returns nothing so it works.

and i just successfully rebooted it. o_O

thanks for the help
 
Joined
Oct 22, 2019
Messages
3,641
NOW RUN "RM -RF /" AND THEN TOSS YOUR SERVER OUT THE WINDOW AND DO IT ALL OVER AGAIN!!!! YEAHHHHHHH!!!

Ahem... sorry... got carr-, nevermind. :oops:

...

Glad it worked!
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
removed the blacklist and rebooted.

ran this command as you suggested... i have two modules to blacklist...





returns nothing so it works.

and i just successfully rebooted it. o_O

thanks for the help

I'll assume it also updates successfully and mark this as SOLVED.
 
Top