Sample Header Ad - 728x90

What is the correct procedure to load a kernel module at boot in RHEL/CentOS 2.1 (kernel 2.4.x)?

3 votes
1 answer
279 views
I am working my way backwards through various historical Linux distributions and have come up against a roadblock with disk management. RHEL/CentOS 2.1 ships with Linux kernel 2.4.x, which includes very early support for SATA devices. I have already updated to the final release kernel version 2.4.9-e.74, which includes support for the necessary kernel module sata_sil.o. However, I can't get the attached device to appear when I run fdisk -l, so I cannot mount it. I can see my primary disk on the ATA bus:
# fdisk -l

Disk /dev/hda: 255 heads, 63 sectors, 15566 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        64    512000   83  Linux
Partition 1 does not end on cylinder boundary:
     phys=(63, 221, 30) should be (63, 254, 63)
/dev/hda2            64       325   2097152   82  Linux swap
Partition 2 does not end on cylinder boundary:
     phys=(324, 242, 46) should be (324, 254, 63)
/dev/hda3           325     15567 122424320   83  Linux
My SATA drive is detected by the adapter itself but is not recognized by the operating system at boot, which I think is the source of the problem. I have to manually load the kernel module every time.
# modprobe -a sata_sil
  Vendor: ATA       Model: CT500MX500SSD1    Rev: M3CR
  Type:   Direct-Access                      ANSI SCSI revision: 05
The device is detected properly, which can be confirmed through dmesg.
# dmesg
...
SCSI subsystem driver Revision: 1.00
libata version 1.02 loaded.
sata_sil version 0.54
PCI: Found IRQ 10 for device 00:09.0
PCI: Sharing IRQ 10 with 00:04.2
ata1: SATA max UDMA/100 cmd 0xE89B3080 ctl 0xE89B308A bmdma 0xE89B3000 irq 10
ata2: SATA max UDMA/100 cmd 0xE89B30C0 ctl 0xE89B30CA bmdma 0xE89B3008 irq 10
ata1: dev 0 cfg 49:2f00 82:706b 83:7409 84:4163 85:7069 86:b409 87:4163 88:407f
ata1: dev 0 ATA, max UDMA/133, 976773168 sectors: lba48
ata1: dev 0 configured for UDMA/100
ata2: no device found (phy stat 00000000)
scsi0 : sata_sil
scsi1 : sata_sil
  Vendor: ATA       Model: CT500MX500SSD1    Rev: M3CR
  Type:   Direct-Access                      ANSI SCSI revision: 05
I can also see the device in /proc/scsi/scsi.
# cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: ATA      Model: CT500MX500SSD1   Rev: M3CR
  Type:   Direct-Access                    ANSI SCSI revision: 05
Red Hat Enterprise Linux 2.1 uses an older kernel (2.4 series), which predates the /sys filesystem introduced in the 2.6 kernel series. Therefore, rescanning for devices in RHEL 2.1 has to be done differently than in later releases. ChatGPT provided the following recommendation. > **Rescan SCSI Bus Manually** > > In older systems, SATA devices were often treated as SCSI devices. You > can try forcing a rescan of the SCSI bus by writing to the > /proc/scsi/scsi interface. This can sometimes help the system > recognize new drives. > > To rescan the SCSI bus, do the following: > > First, identify the SCSI host adapter: >
>     cat /proc/scsi/scsi
>
> Then, trigger a rescan of the SCSI bus: >
>     echo "scsi add-single-device H C I L" > /proc/scsi/scsi
>
> Replace H, C, I, and L with the host, channel, ID, and LUN of > your drive. For example, if your device is on host 0, channel 0, ID 0, > and LUN 0, the command would be: >
>     echo "scsi add-single-device 0 0 0 0" > /proc/scsi/scsi
>
> Check dmesg for any output related to the new device. This did not have any result. I would like to get this working, as I have been able to get CentOS 3.9, 4.9, 5.11, and 6.10 all working with this same SATA adapter. I have other plans for the ATA bus and would prefer to have this system booting off of the SATA adapter, if possible. Although Silicon Image did release official Linux drivers, they only provided precompiled kernel modules, none of which are compatible. My only option is the sata_sil kernel module. From the experience I have gained working backwards through these older releases, I believe that there is nothing wrong with the driver and that this is some kind of user error. The sata_sil kernel module was not included in the original 2.4.9-e.40 kernel release, so I believe the issue is that the kernel module isn't loading before the system scans for attached devices, and I don't know how to get it working. I tried adding the following line to /etc/modules.conf, but it did not cause the kernel module to load during boot.
alias sii3112 sata_sil
I have tried running the kudzu a hardware detection utility.
kudzu --probe
I believe this is run automatically at boot anyways, but I can confirm that the adapter is being detected correctly, as well as the correct kernel module being specified for it by examining /etc/sysconfig/hwconf.
...
class: OTHER
bus: PCI
detached: 0
driver: sata_sil
desc: "CMD Technology Inc|Silicon Image SiI 3112 SATARaid Controller"
vendorId: 1095
deviceId: 3112
subVendorId: 1095
subDeviceId: 3112
pciType: 1
...
I tried adding modprobe sata_sil to /etc/rc.local. Although this does ensure that the kernel module is loaded at boot, this file is executed *after* all other init scripts, which is no different from loading it after logging in, which doesn't allow the device to appear in fdisk -l. I also tried creating a new initrd after loading the sata_sil kernel module. This didn't work either.
# mkinitrd initrd-2.4.9-e.74.img 2.4.9-e.74
What is the correct procedure to configure the system to load the sata_sil kernel module at boot in RHEL/CentOS 2.1 (kernel 2.4.x)? I would also like to know if it's possible to rescan the SCSI/SATA bus at runtime to get the drive working without having to reboot. Additional Information ---------------------- This question includes examples which indicate that I was testing with a Crucial MX500 500GB (CT500MX500SSD1). I don't know if LBA48 support was ever backported to this particular kernel, but this is not the source of the problem. I confirmed this by swapping the drive for a 128GB one and continue to have the same issue. Progress -------- I've managed to find a workaround to get these disks to be detected and mount. The initrd needs to be remade using the options --with=scsi_mod --with=sd_mod --with=sata_sil. Adding these modules to /etc/modules.conf doesn't make a difference.
mkinitrd --with=scsi_mod --with=sd_mod --with=sata_sil /boot/initrd-$(uname -r).img $(uname -r)
There is still one more step though. modprobe sata_sil still needs to be called after the system has booted, either manually or through rc.local. The output is also different from before, with additional output showing that the drive has been attached.
# modprobe sata_sil
  Vendor: ATA       Model: Samsung SSD 850   Rev: EXM0
  Type:   Direct-Access                      ANSI SCSI revision: 05
Attached scsi disk sda at scsi1, channel 0, id 0, lun 0
SCSI device sda: 250069680 512-byte hdwr sectors (128036 MB)
Although this does allow me to mount a SATA drive, because the process does not occur automatically during the boot process, I cannot boot from this drive, which is my intention. I can confirm that this isn't an issue with the sata_sil kernel module specifically. I replicated the same problem and workaround with a Promise branded SATA controller. How can I get the system to load this module automatically and early enough so that it can be made bootable?
Asked by Zhro (2831 rep)
Oct 2, 2024, 06:48 AM
Last activity: Oct 4, 2024, 03:26 AM