Kmod-megaraid_sas driver and kernels on Rocky 8.7

I am trying to understand the proper usage of the megaraid driver.

I see that the megaraid driver is in the elrepo
https://rhel.pkgs.org/8/elrepo-x86_64/kmod-megaraid_sas-07.719.03.00-2.el8_7.elrepo.x86_64.rpm.html

however it installs in kernel 4.18.0-425.10.1.el8_7.x86_64

/etc/depmod.d/kmod-megaraid_sas.conf
/lib/modules/4.18.0-425.10.1.el8_7.x86_64/
/lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/
/lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko
/usr/share/doc/kmod-megaraid_sas-07.719.03.00/GPL-v2.0.txt
/usr/share/doc/kmod-megaraid_sas-07.719.03.00/greylist.txt

I see the most recent kernel is kernel-core-4.18.0-425.19.2.el8_7.x86_64
https://rockylinux.pkgs.org/8/rockylinux-baseos-x86_64/kernel-core-4.18.0-425.19.2.el8_7.x86_64.rpm.html

If I install the megaraid driver and try to boot into this kernel it can’t find my raid1 OS drive that is on a megaraid controller on the motherboard and so it drops into the dracut# rescue shell.

If instead I use linux-lt kernel with the megaraid driver as part of the kernel it boots fine.

Can you show us the output from:

$ find /lib/modules -name megaraid_sas.ko

$ lspci -nn (pick up the line related to the controller)

There are currently 2 MegaRAID controllers. The first I believe is a SAS2 card with external ports. The second is the card that contains the boot raid.

root@datastore6 ~ $ lspci -nn | grep Mega
01:00.0 RAID bus controller [0104]: Broadcom / LSI MegaRAID SAS 2208 [Thunderbolt] [1000:005b] (rev 05)
04:00.0 RAID bus controller [0104]: Broadcom / LSI MegaRAID SAS 1078 [1000:0060] (rev 04)

root@datastore6 ~ $ find /lib/modules -name megaraid_sas.ko
/lib/modules/4.18.0-425.19.2.el8_7.x86_64/weak-updates/megaraid_sas/megaraid_sas.ko
/lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko

Oddly the weak-updates folder has todays date. I spent many hours yesterday working on the non boot situation.

root@datastore6 ~ $ ls -al /lib/modules/4.18.0-425.19.2.el8_7.x86_64/weak-updates
total 4
drwxr-xr-x. 4 root root 43 Apr 20 10:15 .
drwxr-xr-x. 6 root root 4096 Apr 20 16:47 …
drwxr-xr-x. 4 root root 28 Apr 20 10:15 kmod-kvdo
drwxr-xr-x. 2 root root 29 Apr 20 10:15 megaraid_sas

My guess this was somehow added today with a different install. I this today:

dnf groupinstall “Server with GUI”

The date and time of the system are correct.

root@datastore6 ~ $ timedatectl
Local time: Thu 2023-04-20 16:55:02 EDT
Universal time: Thu 2023-04-20 20:55:02 UTC
RTC time: Thu 2023-04-20 20:55:02
Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

I can not reboot to test the weak-updates at the moment. I am working from home.

First, I see that both devices [1000:005b] and [1000:0060] are supported by the kmod-megaraid_sas package. You can see the aliases by running:

$ modinfo megaraid_sas

Or by looking up the device IDs page [1].

Second, the .ko file in the extra directory was installed when you installed the kmod package. Then when you installed a newer kernel, the one in the weak-updates was created as a symbolic link, thanks to the kABI-tracking nature [2] of the kmod. This is better seen if you use a ‘ls -l’ command like so:

$ ls -l `find /lib/modules -name megaraid_sas.ko`
-rw-r--r--. 1 root root 331697 Feb 12 05:56 /lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko
lrwxrwxrwx. 1 root root     76 Apr 20 17:15 /lib/modules/4.18.0-425.13.1.el8_7.x86_64/weak-updates/megaraid_sas/megaraid_sas.ko -> /lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko
lrwxrwxrwx. 1 root root     76 Apr 20 17:15 /lib/modules/4.18.0-425.19.2.el8_7.x86_64/weak-updates/megaraid_sas/megaraid_sas.ko -> /lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko

[1] ELRepo | DeviceIDs
[2] ELRepo | FAQ

root@datastore6 ~ $ ls -l find /lib/modules -name megaraid_sas.ko
-rw-r–r–. 1 root root 331697 Feb 12 05:56 /lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko
lrwxrwxrwx. 1 root root 76 Apr 20 10:15 /lib/modules/4.18.0-425.19.2.el8_7.x86_64/weak-updates/megaraid_sas/megaraid_sas.ko → /lib/modules/4.18.0-425.10.1.el8_7.x86_64/extra/megaraid_sas/megaraid_sas.ko

Thanks a lot. I think I understand how it’s supposed to work now.

For the modinfo I am currently running the kernel-lt (since it had the megaraid already without the separate package) so it shows this:

root@datastore6 ~ $ modinfo megaraid_sas
filename: /lib/modules/5.4.240-1.el8.elrepo.x86_64/kernel/drivers/scsi/megaraid/megaraid_sas.ko.xz
description: Broadcom MegaRAID SAS Driver
author: megaraidlinux.pdl@broadcom.com
version: 07.710.50.00-rc1
license: GPL
srcversion: 33FF3DF0B51178539DF6B80
alias: pci:v00001000d000010E7svsdbcsci*
alias: pci:v00001000d000010E4svsdbcsci*
alias: pci:v00001000d000010E3svsdbcsci*
alias: pci:v00001000d000010E0svsdbcsci*
alias: pci:v00001000d000010E6svsdbcsci*
alias: pci:v00001000d000010E5svsdbcsci*
alias: pci:v00001000d000010E2svsdbcsci*
alias: pci:v00001000d000010E1svsdbcsci*
alias: pci:v00001000d0000001Csvsdbcsci*
alias: pci:v00001000d0000001Bsvsdbcsci*
alias: pci:v00001000d00000017svsdbcsci*
alias: pci:v00001000d00000016svsdbcsci*
alias: pci:v00001000d00000015svsdbcsci*
alias: pci:v00001000d00000014svsdbcsci*
alias: pci:v00001000d00000053svsdbcsci*
alias: pci:v00001000d00000052svsdbcsci*
alias: pci:v00001000d000000CFsvsdbcsci*
alias: pci:v00001000d000000CEsvsdbcsci*
alias: pci:v00001000d0000005Fsvsdbcsci*
alias: pci:v00001000d0000005Dsvsdbcsci*
alias: pci:v00001000d0000002Fsvsdbcsci*
alias: pci:v00001000d0000005Bsvsdbcsci*
alias: pci:v00001028d00000015svsdbcsci*
alias: pci:v00001000d00000413svsdbcsci*
alias: pci:v00001000d00000071svsdbcsci*
alias: pci:v00001000d00000073svsdbcsci*
alias: pci:v00001000d00000079svsdbcsci*
alias: pci:v00001000d00000078svsdbcsci*
alias: pci:v00001000d0000007Csvsdbcsci*
alias: pci:v00001000d00000060svsdbcsci*
alias: pci:v00001000d00000411svsdbcsci*
depends:
retpoline: Y
intree: Y
name: megaraid_sas
vermagic: 5.4.240-1.el8.elrepo.x86_64 SMP mod_unload modversions
parm: lb_pending_cmds:Change raid-1 load balancing outstanding threshold. Valid Values are 1-128. Default: 4 (int)
parm: max_sectors:Maximum number of sectors per IO command (int)
parm: msix_disable:Disable MSI-X interrupt handling. Default: 0 (int)
parm: msix_vectors:MSI-X max vector count. Default: Set by FW (int)
parm: allow_vf_ioctls:Allow ioctls in SR-IOV VF mode. Default: 0 (int)
parm: throttlequeuedepth:Adapter queue depth when throttled due to I/O timeout. Default: 16 (int)
parm: resetwaittime:Wait time in (1-180s) after I/O timeout before resetting adapter. Default: 180s (int)
parm: smp_affinity_enable:SMP affinity feature enable/disable Default: enable(1) (int)
parm: rdpq_enable:Allocate reply queue in chunks for large queue depth enable/disable Default: enable(1) (int)
parm: dual_qdepth_disable:Disable dual queue depth feature. Default: 0 (int)
parm: scmd_timeout:scsi command timeout (10-90s), default 90s. See megasas_reset_timer. (int)
parm: perf_mode:Performance mode (only for Aero adapters), options:
0 - balanced: High iops and low latency queues are allocated &
interrupt coalescing is enabled only on high iops queues
1 - iops: High iops queues are not allocated &
interrupt coalescing is enabled on all queues
2 - latency: High iops queues are not allocated &
interrupt coalescing is disabled on all queues
default mode is ‘balanced’ (int)
parm: event_log_level:Asynchronous event logging level- range is: -2(CLASS_DEBUG) to 4(CLASS_DEAD), Default: 2(CLASS_CRITICAL) (int)
parm: enable_sdev_max_qd:Enable sdev max qd as can_queue. Default: 0 (int)