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.
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.
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.
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.