Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Disable modules

Need help with peripherals or devices?
Post Reply
Message
Author
banderas20
Posts: 111
Joined: 2016-11-10 15:30

Disable modules

#1 Post by banderas20 »

Hi all.

I am practising with

Code: Select all

lsmod
, and I'm trying to disable Bluetooth module to speed up the system, since I don't use it.

I have removed it using

Code: Select all

modprobe -r
but it appears again upon restart.
¿How can I avoid this behaviour?

Thanks!

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#2 Post by banderas20 »

wizard10000 wrote:Easiest way? As root:

Code: Select all

systemctl stop bluetooth.service
systemctl disable bluetooth.service
Next easiest way? Uninstall bluetooth.

Next easiest way? Blacklist the kernel module.

Hope this helps -
If I stop bluetooth.service, ¿won't it load again when I restart?

BTW, according to https://wiki.archlinux.org/index.php/Ke ... acklisting,

Code: Select all

"but the module may be loaded if another non-blacklisted module depends on it or if it is loaded manually. "
My

Code: Select all

lsmod
output is this:

Code: Select all

bluetooth             374429  21 bnep,btusb
¿21 modules using bluetooth?
¿and yet only 2 listed?

Many thanks!

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Disable modules

#3 Post by phenest »

Do you have a BIOS setting to disable Bluetooth? Saves mucking around with software.
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#4 Post by banderas20 »

I didn't see the "disable" word.

Many thanks!

User avatar
phenest
Posts: 1702
Joined: 2010-03-09 09:38
Location: The Matrix

Re: Disable modules

#5 Post by phenest »

Probably not. You will see it's "enabled", yes? If so, change "enabled" to "disabled".
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Disable modules

#6 Post by pylkko »

wizard10000 wrote:Easiest way? As root:

Code: Select all

systemctl stop bluetooth.service
systemctl disable bluetooth.service
Next easiest way? Uninstall bluetooth.

Next easiest way? Blacklist the kernel module.

Hope this helps -
Correct me if l'm wrong, but you need to use mask to prevent other software from reactivation bluetooth.service like:

Code: Select all

systemctl disable bluetooth
systemctl mask bluetooth
Also, this would only stop user space bluetooth stuff, the kernel would still load bluetooth.ko and all related things (hhid, bnep etc)

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#7 Post by banderas20 »

wizard10000 wrote: Excellent point. Shutting it off in BIOS or blacklisting the driver works for me.
¿And how do you blacklist it? I have edited

Code: Select all

/etc/modprobe.d/blacklist.conf
with

Code: Select all

blacklist bluetooth
, then rebooted and still shows in

Code: Select all

lsmod
. :(

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Disable modules

#8 Post by Segfault »

It may be different with systemd ... my 2¢.

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#9 Post by banderas20 »

Segfault wrote:It may be different with systemd ... my 2¢.
Good point. I'll check it out. I'm using systemd on Debian7.

Thanks!

User avatar
Thorny
Posts: 542
Joined: 2011-02-27 13:40

Re: Disable modules

#10 Post by Thorny »

banderas20 wrote: ...and I'm trying to disable Bluetooth module to speed up the system, since I don't use it.
I wonder, what sort of "speed up" of the system do you expect to achieve by disabling an unused bluetooth module? I'm not suggesting that you shouldn't disable any module you want to but will you be able to measure or perceive a "speed up"?

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#11 Post by banderas20 »

Thorny wrote:
banderas20 wrote: ...and I'm trying to disable Bluetooth module to speed up the system, since I don't use it.
I wonder, what sort of "speed up" of the system do you expect to achieve by disabling an unused bluetooth module? I'm not suggesting that you shouldn't disable any module you want to but will you be able to measure or perceive a "speed up"?
Maybe "speed up" is not the right word. But tune it to the specific needs. If I'm not going to use Bluetooth, I want to load just the necessary modules.

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Disable modules

#12 Post by Segfault »

Roll your own kernel and get rid of all unnecessary modules at once.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: Disable modules

#13 Post by pylkko »

banderas20 wrote:
Thorny wrote:
banderas20 wrote:Maybe "speed up" is not the right word. .
No it is not. On this low end laptop that I am using now, kernel boot time is 3.9 seconds according to systemd-analyze (user space is 7 and grub 2 and firmware sometihng). Pulling out modules will likely do nothing noticeable unless your using some 20 year old processor or really short on RAM. But it can be an interesting intellectual ordeal to try to roll a custom made kernel.

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Disable modules

#14 Post by Segfault »

My Wife's box. Custom kernel 4.10.1, 3.6 MiB compressed, no modules, Radeon firmware built in. No initramfs, indeed. UEFI boot with EFI stub kernel. How big is the stock kernel and how many modules it loads?

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#15 Post by banderas20 »

Segfault wrote:Roll your own kernel and get rid of all unnecessary modules at once.
I'm too newbie to compile my own kernel yet :D

Segfault
Posts: 993
Joined: 2005-09-24 12:24
Has thanked: 5 times
Been thanked: 17 times

Re: Disable modules

#16 Post by Segfault »

My first Linux was RH-5.0. It came with kernel 2.0. Which did not have the driver for my Gravis Ultrasound. I had to patch the kernel to make my sound work. I was complete newbie in Linux and all documentation was in English. I knew about ten words in English. So I was learning Linux, kernel and English at the same time. I succeeded. What you are waiting for?

banderas20
Posts: 111
Joined: 2016-11-10 15:30

Re: Disable modules

#17 Post by banderas20 »

Segfault wrote:My first Linux was RH-5.0. It came with kernel 2.0. Which did not have the driver for my Gravis Ultrasound. I had to patch the kernel to make my sound work. I was complete newbie in Linux and all documentation was in English. I knew about ten words in English. So I was learning Linux, kernel and English at the same time. I succeeded. What you are waiting for?
Nothing. I must get deep into it in order to learn. 8)

Post Reply