LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-11-2017, 11:20 AM   #1
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Rep: Reputation: Disabled
Deleted driver still loads


Hi,

On my Centos system, this is my nvme driver:

/lib/modules/3.16.0-38-generic/kernel/drivers/block/nvme.ko

When system boots this driver gets loaded automatically. Running lsmod shows that this driver is loaded and using modprobe -r or rmmod I can unload the driver.

I deleted this driver file and rebooted the system but the driver still loads! lsmod detects the driver and I can unload the driver. modinfo nvme says it cant find /lib/modules/3.16.0-38-generic/kernel/drivers/block/nvme.ko.

find / -name nvme.ko does not find any nvme driver on the system.

I know I can add the driver to the blacklist so it wont load, but what I want to know is where on earth is Linux loading the driver from?

TIA
Nisha
 
Old 01-11-2017, 11:43 AM   #2
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,737

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
Howto: Linux Add or Remove a Linux Kernel Modules / Drivers

and / or

http://www.linuxquestions.org/questi...kernel-801334/

Last edited by BW-userx; 01-11-2017 at 11:46 AM.
 
Old 01-11-2017, 12:17 PM   #3
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you for your response. But I already know all that. What I want to know is where is Linux finding the nvme driver even though I have deleted it from disk.

And sorry about the dual post. I hit my browser refresh and that msg got reposted.

TIA
Nisha
 
Old 01-11-2017, 12:33 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,258

Rep: Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436
Quote:
Originally Posted by miller420 View Post
Thank you for your response. But I already know all that. What I want to know is where is Linux finding the nvme driver even though I have deleted it from disk.

And sorry about the dual post. I hit my browser refresh and that msg got reposted.
The /lib/modules/... directory you specified...are you absolutely certain that it matches your running kernel? "uname -a" will tell you. If not, that module may be present for several other kernels on your system, and you only removed one. Run "sudo find /lib/modules -name nvme.ko", and see what you find.
 
Old 01-11-2017, 12:51 PM   #5
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
The /lib/modules/... directory you specified...are you absolutely certain that it matches your running kernel? "uname -a" will tell you. If not, that module may be present for several other kernels on your system, and you only removed one. Run "sudo find /lib/modules -name nvme.ko", and see what you find.
I'm absolutely certain that my /lib/modules dir matches my running kernel. I made sure of that. Besides, as root, I ran find / -name nvme.ko and it finds nothing. That is why I'm so perplexed!

TIA
Nisha
 
Old 01-11-2017, 01:39 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 19,258

Rep: Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436Reputation: 4436
Quote:
Originally Posted by miller420 View Post
I'm absolutely certain that my /lib/modules dir matches my running kernel. I made sure of that. Besides, as root, I ran find / -name nvme.ko and it finds nothing. That is why I'm so perplexed!
Sorry...something here isn't correct.

That file/module comes from somewhere....if you did a find on the root ("/") directory, as you said (and you RAN that find as root/sudo), it'll return a name. I have that module in several of my kernel directories. So either it doesn't match, or the find wasn't run with sufficient permissions to actually find the file.

Re-run the find AS ROOT, for the /lib/modules directory ONLY, as specified.
 
Old 01-11-2017, 01:54 PM   #7
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,863

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
Could it be in ramfs?
 
1 members found this post helpful.
Old 01-11-2017, 03:48 PM   #8
BW-userx
Senior Member
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Void Linux / Slackware 14.2
Posts: 4,737

Rep: Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877Reputation: 877
Quote:
Originally Posted by miller420 View Post
Thank you for your response. But I already know all that. What I want to know is where is Linux finding the nvme driver even though I have deleted it from disk.

And sorry about the dual post. I hit my browser refresh and that msg got reposted.

TIA
Nisha
you did not look into this post far enough where someone within it goes into how to blacklist as you asked how to do.
http://www.linuxquestions.org/questi...kernel-801334/

also, as others in here stated. you may have more then one kernel / source / modules installed on your system using

Code:
ls /lib/modules/$(uname -r)/kernel/drivers/
$(uname -r) to be sure you are getting the one that is loaded on boot up is important.

my system shows this (because I do not rid my kernels every time they are updated)

Code:
userx@voider/etc/lxdm:>> ls /lib/modules
4.5.7_1  4.8.15_1  4.8.16_1  4.8.17_1  4.9.2_1
but to get the one I am running I use this to get the right one.

Code:
userx@voider/etc/lxdm:>> uname -r
4.9.2_1

userx@voider/etc/lxdm:>> ls /lib/modules/$(uname -r)
kernel             modules.builtin      modules.dep.bin  modules.softdep
modules.alias      modules.builtin.bin  modules.devname  modules.symbols
modules.alias.bin  modules.dep          modules.order    modules.symbols.bin
another thought - it maybe built into the kernel itself so no need for a module?

Last edited by BW-userx; 01-11-2017 at 04:01 PM.
 
Old 01-11-2017, 04:05 PM   #9
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by BW-userx View Post
you did not look into this post far enough where someone within it goes into how to blacklist as you asked how to do.
http://www.linuxquestions.org/questi...kernel-801334/

also, as others in here stated. you may have more then one kernel / source / modules installed on your system using

Code:
ls /lib/modules/$(uname -r)/kernel/drivers/
$(uname -r) to be sure you are getting the one that is loaded on boot up is important.

my system shows this (because I do not rid my kernels every time they are updated)

Code:
userx@voider/etc/lxdm:>> ls /lib/modules
4.5.7_1  4.8.15_1  4.8.16_1  4.8.17_1  4.9.2_1
but to get the one I am running I use this to get the right one.

Code:
userx@voider/etc/lxdm:>> uname -r
4.9.2_1

userx@voider/etc/lxdm:>> ls /lib/modules/$(uname -r)
kernel             modules.builtin      modules.dep.bin  modules.softdep
modules.alias      modules.builtin.bin  modules.devname  modules.symbols
modules.alias.bin  modules.dep          modules.order    modules.symbols.bin
another thought - it maybe built into the kernel itself so no need for a module?
I already know how to blacklist my driver. I'm trying to understand where Linux finds the nvme driver although I have deleted all intances of nvme.ko

If the driver was built into the kernel, then lsmod would not show it and rmmod nvme would not work, both of which work for me.

Nisha
 
Old 01-11-2017, 04:10 PM   #10
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Sorry...something here isn't correct.

That file/module comes from somewhere....if you did a find on the root ("/") directory, as you said (and you RAN that find as root/sudo), it'll return a name. I have that module in several of my kernel directories. So either it doesn't match, or the find wasn't run with sufficient permissions to actually find the file.

Re-run the find AS ROOT, for the /lib/modules directory ONLY, as specified.
As root I did:

find /lib/modules -name nvme.ko and nothing was displayed. Then I did

cd /lib/modules
find . -name nvme.ko

and again nothing was displayed.

I logged modprobe output to a file while the system was booting, and in the log I see this:

alias pci:v*d*sv*sd*bc01sc08i02* nvme

could this point to something?

TIA
Nisha
 
Old 01-11-2017, 05:00 PM   #11
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
Could it be in ramfs?
I checked. Its not in ramfs.

thanks
Nisha
 
Old 01-12-2017, 01:36 PM   #12
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 6,760
Blog Entries: 3

Rep: Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628Reputation: 1628
Quote:
Originally Posted by miller420 View Post
I logged modprobe output to a file while the system was booting, and in the log I see this:

alias pci:v*d*sv*sd*bc01sc08i02* nvme

could this point to something?
interesting:
https://duckduckgo.com/?q=kernel+module+alias
i think you're on to something...
 
Old 01-13-2017, 11:01 AM   #13
miller420
LQ Newbie
 
Registered: Jan 2017
Posts: 9

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
Could it be in ramfs?
The issue was initramfs. After deleting the driver I had to run dracut -f to regenerate initramfs. Once I did that it worked!

Nisha
 
3 members found this post helpful.
Old 01-13-2017, 12:04 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,863

Rep: Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959Reputation: 1959
Quote:
Originally Posted by miller420 View Post
The issue was initramfs. After deleting the driver I had to run dracut -f to regenerate initramfs. Once I did that it worked!

Nisha
I did wonder but I'm not confident enough in my kernel compiling and installation skills to have questioned it any further.
Glad you sorted it and thanks for posting your solution so others can benefit.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
nvidia 6150 driver loads sometimes on restart sometimes it does not. breitscott Linux - Desktop 3 04-29-2007 12:21 AM
Linux Driver loads automatically? binarybob0001 Linux - Software 6 09-03-2006 12:18 PM
NFORCE 2 Sound - Old intel driver loads back psychoholic Linux - Hardware 1 01-20-2006 01:51 PM
Wireless card, driver loads, now what? Oxyacetylene Linux - Wireless Networking 6 08-14-2005 11:06 PM
Alsa loads wrong driver when hotplug runs first ministre Linux - Hardware 2 11-21-2004 05:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration