Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On a "Linux debian 2.6.32-5-amd64 #1 SMP" installation where loading a kernel module (mpt2sas) is desired to be delayed to be loaded after starting sshd and users can remotely login, the mpt2sas module was disabled from loading in single user boot, by:

$ echo 'blacklist mpt2sas' >> /etc/modprobe.d/mpt2sas.conf; depmod -aeF /boot/System.map-2.6.32-5-amd64; update-initramfs -u -k $(uname -r)

Later on a modeprobe -v mpt2sas will be run in /etc/rc.local.

After installing a newer mpt2sas driver, using dpkg -i mpt2sas-15.00.00.00-3_Debian6.0.5.amd64.deb the result is that the old driver is renamed from /lib/modules/2.6.32-5-amd64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko to /lib/modules/2.6.32-5-amd64/kernel/drivers/scsi/mpt2sas/mpt2sas.ko.orig and the new driver is installed at /lib/modules/2.6.32-5-amd64/weak-updates/mpt2sas/mpt2sas.ko.

The side effect is that the line blacklist mpt2sas in /etc/modprobe.d/mpt2sas.conf no longer has any effect, when modules are loaded in the single user boot process, mpt2sas is loaded as first kernel module.

Regression:

  • I know that /etc/modprobe.d/mpt2sas.conf is still being loaded, because when entering a faulty line in this file, a warning is display at console during boot (4 times).
  • Running depmod -aeF /boot/System.map-2.6.32-5-amd64; update-initramfs -u -k -t $(uname -r); reboot doesn't improve.
  • Adding kernel boot parameter modprobe.blacklist=mpt2sas doesn't improve.

How can I block loading the new mpt2sas kernel module during the single user boot phase? (I still want to load mpt2sas using modprobe in /etc/rc.local).

share|improve this question
    
I’m not sure what exactly init system do you use, but in OpenRC you can configure a service named ‘local’ through /etc/conf.d/local and define there functions local_start and local_stop, put your modprobe line in local_start then move local service to desired position, e.g. if your sshd is running at runlevel ‘boot’ place ‘local’ to default runlevel with your rc-script managing utility (rc-update, update-rc.d or something), or specify sshd in need dependencies for ‘local’ service in rc.conf (there are many examples). –  tijagi Dec 21 '12 at 6:14
1  
Please add details about your OS. Debian/Ubuntu? Version? On SLES this would be solved by removing unwanted drivers from /etc/sysconfig/kernel followed by mkinitrd. –  Nils Dec 21 '12 at 21:30
    
@Nils The OS was hidden in the driver name, mpt2sas-15.00.00.00-3_**Debian**6.0.5.amd64.deb. I will add OS and version more explicitly to the base question. –  Pro Backup Dec 21 '12 at 21:32
    
Is this question of yours not about just the same? –  Nils Dec 21 '12 at 21:34
1  
@Nils That question is not about the same. That question is about installing a newer driver. This question is about blocking it from loading in single user boot mode, after having loaded that newer mpt2sas driver version. –  Pro Backup Dec 21 '12 at 21:36

2 Answers 2

up vote 4 down vote accepted

Check that your module is not listed in file /etc/modules. This file lists the modules that must be loaded at boot time according to http://www.debian.org/doc/manuals/debian-faq/ch-kernel.en.html#s-modules

When the module name - mpt2sas in this case - is listed in file /etc/modules:

  1. Remove that mpt2sas line or comment it by prepending a hash. Line "mpt2sas" becomes "#mpt2sas".
  2. Update the initramfs image file: depmod -aeF /boot/System.map-$(uname -r) && update-initramfs -u -k $(uname -r) -t
  3. And reboot
share|improve this answer
    
facepalm - this must have been too obvious to have overlooked! Anyway, you have edited the /etc/modules file yourself, probably. –  gertvdijk Dec 28 '12 at 13:31
    
@gertvdijk For a Linux novice nothing is obvious at all. –  Pro Backup Dec 28 '12 at 13:37

Add this to your kernel boot command line (in e.g. Grub, press e and edit the kernel boot parameters):

modprobe.blacklist=mpt2sas

More on this on the Arch wiki.

share|improve this answer
    
This kernel parameter modprobe.blacklist=mpt2sas does not change the loading of the /weak-updates/mpt2sas.ko module during boot in our case. –  Pro Backup Dec 23 '12 at 19:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.