Kernel module mpt3sas not loading at boot in Rocky 9

cat /etc/os-release
NAME=“Rocky Linux”
VERSION=“9.7 (Blue Onyx)”
ID=“rocky”
ID_LIKE=“rhel centos fedora”
VERSION_ID=“9.7”
PLATFORM_ID=“platform:el9”
PRETTY_NAME=“Rocky Linux 9.7 (Blue Onyx)”
ANSI_COLOR=“0;32”
LOGO=“fedora-logo-icon”
CPE_NAME=“cpe:/o:rocky:rocky:9::baseos”
HOME_URL=“https://rockylinux.org/”
VENDOR_NAME=“RESF”
VENDOR_URL=“https://resf.org/”
BUG_REPORT_URL=“https://bugs.rockylinux.org/”
SUPPORT_END=“2032-05-31”
ROCKY_SUPPORT_PRODUCT=“Rocky-Linux-9”
ROCKY_SUPPORT_PRODUCT_VERSION=“9.7”
REDHAT_SUPPORT_PRODUCT=“Rocky Linux”
REDHAT_SUPPORT_PRODUCT_VERSION=“9.7”

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
dnf install --enablerepo=elrepo-kernel kmod-mpt3sas
reboot

The attached disk drives do not appear in fdisk -l

run modprobe mpt3sas then the disk drives show up

It suggests to me the modules “mpt3sas” is not loading in the kernel during boot

FYI, I have the 2nd controller running in a older machine on Rock linux 8. It’s running just fine with the same mpt3sas (different version maybe…)

Correction….

After reboot, I repeated the same procedure.

#modprobe -r mpt3sas

#modprobe mpt3sas

This appears to work fine until this reboot

Would probably be fixed by creating /etc/modules-load.d/mpt3sas.conf with the following content:

mpt3sas

example from man modules-load.d which is what I used for the above:

EXAMPLE
       Example 1. /etc/modules-load.d/virtio-net.conf example:

           # Load virtio-net.ko at boot
           virtio-net

then your module will be loaded at boot. Hope that helps.

I followed you suggestion and created the file “/etc/modules-load/mpt3sas.conf”

It contain one line ‘mpt3sas’

How ever, it didn’t solve the problem.
I think the module mpt3sas needed to load at last during boot-up. Something needed to be running 1st.

The fact that I needed to unload the module and reload it again to make it functional

# modprobe -r mpt3sas

# modprobe mpt3sas

suggest to me mpt3sas is loaded at the wrong time during boot

It could be that you have to remake your initrd file to include it in early boot.
man dracut is a good start point for example commands to do this.

1 Like

As @jbkt23 says this additional command should also help for the initrd:

dracut --regenerate-all --force

Yes, this clearly smells like a timing problem with initramfs, not a missing module. If mpt3sas only works when you unload and reload it by hand, it’s being loaded before the hardware stack is ready.

On Rocky 9, merely putting it in /etc/modules-load.d/ isn’t always adequate because that occurs after the early boot. This is a storage driver, thus it really has to be accessible at the initramfs step. That’s why it’s best to use dracut here.

what usually fixes it cleanly:

  • make sure mpt3sas is listed in /etc/dracut.conf.d/mpt3sas.conf

    add_drivers+=" mpt3sas "
    
    
  • then rebuild initramfs:

    dracut --regenerate-all --force
    
    

after that, reboot and check dmesg | grep mpt3sas to confirm it’s loading early and only once.

When HBAs rely on time or firmware init, this pattern happens a lot on rocky/rhel. The manual reload hack shouldn’t be necessary longer once it’s integrated into initrd.

Thank you guys,

Just to confess, I’m a simple user of linux. these low level stuffs is beyond my skill level. I stay away things like dracut. This Rocky 9 is my new linux box, I’m trying the migrate my current Rocky 8 over. I can mess around with it at no risk to my current system. I’ll let you know on the results.

More info…

I went to my existing Rocky 8 box. I’m not seeing a /etc/dracut.conf.d/mpt3sas.conf exists. My current linux box also has a same HBA installed. I’d installed the same driver on the box.

@kyiu
I’m one of the ELRepo devs. We have a bug in the kmod post-install that needs to be fixed. I’ll let you know ASAP.

1 Like

Great! I rather wait for the fix.

Whilst a file may not exist, that doesn’t necessarily mean that the suggested fix is not valid. If the file was created and dracut fixed the initrd, then that should fix the problem. However, in this case, it’s best to wait for the fix suggested.

Example of which I had recently, I have a bluetooth keyboard, and this usually will not be available during boot process. Files also don’t exist for such situation, but creating one and regenerating initrd will make it available during the boot process. For a keyboard it may not be important whether bluetooth is available during boot or not, at least only until something goes wrong, and you need to rescue the boot process. At which case it’s either having it enabled, or connecting the keyboard via cable (less convenient).

Assuming that a file should exist in a particular location is the wrong way to look at it. And as we know, there are multiple ways to get something fixed - by creating files to sort it out, or by devs of the driver that you are using fixing it so that you don’t have to.

@kyiu
The updated kmod-mpt3sas is in our testing repo mirrors. You should be able to update by running:
dnf --enablerepo elrepo-testing update kmod-mpt3sas

Also you should notice that all of your /boot/initramfs*x86_64.img files are rebuilt.

1 Like

It’s working . Thank you all :+1:

2 Likes