LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 07-23-2014, 11:16 AM   #1
fmagee
LQ Newbie
 
Registered: Jun 2013
Location: Albuquerque, NM
Distribution: RHEL 5.9 Server and Workstation, RHEL 6.4,Server and Workstation, OracleVM, HP/UX, Solaris
Posts: 9

Rep: Reputation: Disabled
Is it safe to remove kernel module when lsmod shows 0 usage


If I run lsmod and get:

Module Size Used by
usb_storage 80929 0

is it safe to remove the module from the current kernel? Are there any possible repercussions? I have some modules loaded that have potential security implications that show "Used by" = 0.

Thanks for your thoughts.
 
Old 07-23-2014, 11:20 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
Quote:
However lsmod o/p is sometimes incomplete. It also does not always indicate all the modules dependent on a given module.
According to this, you can't count on lsmod being correct.
 
1 members found this post helpful.
Old 07-23-2014, 11:50 AM   #3
fmagee
LQ Newbie
 
Registered: Jun 2013
Location: Albuquerque, NM
Distribution: RHEL 5.9 Server and Workstation, RHEL 6.4,Server and Workstation, OracleVM, HP/UX, Solaris
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks to szboardstretcher

Thanks for the information, szboardstretcher.

It's a bit scary lsmod may not be complete in its reporting. I'll file that away for future reference.

Have a great day and thanks again.

Fred
 
Old 07-23-2014, 04:16 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,555
Blog Entries: 4

Rep: Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888Reputation: 3888
Let "hotplug" do any inserting and/or removing of USB driver modules . . .
 
Old 07-23-2014, 04:38 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You can try to remove any modules that have usage=0; if it is required the removal will fail.

The usual reason for modules with a 0 usage count is that controllers have been identified (such as USB) and are not currently being used. Plug in a flash/sd/whatever and it gains an additional usage count as the driver for the particular device gets loaded. Without the controller being loaded (even with usage count being 0) the kernel/udev will not be able to detect the event.

Last edited by jpollard; 07-23-2014 at 04:40 PM.
 
1 members found this post helpful.
Old 07-23-2014, 04:41 PM   #6
fmagee
LQ Newbie
 
Registered: Jun 2013
Location: Albuquerque, NM
Distribution: RHEL 5.9 Server and Workstation, RHEL 6.4,Server and Workstation, OracleVM, HP/UX, Solaris
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks, jpollard.

I've got a test server I can play with to start cleaning things up. I normally wouldn't bother but like my post said, some of these modules have security issues.

Have a great day.
 
  


Reply

Tags
kernel module, lsmod


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
[SOLVED] insmod inserts the module. but lsmod does not list it. using Plx load module utility. cpemmaraju Linux - Kernel 2 05-15-2014 12:58 AM
Multiple Kernel Entries in Grub ... Safe to Remove? SlowCoder Linux - Newbie 2 04-23-2007 10:31 PM
Is it safe to remove 2.4 kernel source? sbme Slackware 3 10-15-2006 08:16 PM
lsmod shows only two modules desertViking Slackware 10 04-24-2006 10:44 AM
lsmod shows way too many modules loaded zenlord Arch 3 03-14-2006 04:27 AM

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

All times are GMT -5. The time now is 08:55 AM.

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
Open Source Consulting | Domain Registration