Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't Insert or remove modules with modprobe
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
satanail
n00b
n00b


Joined: 18 Feb 2018
Posts: 6

PostPosted: Wed Jun 20, 2018 2:41 pm    Post subject: Can't Insert or remove modules with modprobe Reply with quote

Quote:
$ sudo modprobe -r sr_mod
modprobe: ERROR: could not remove 'sr_mod': Operation not permitted


It is like that with every module I tried. It used to work before. All I did was removing 'modules' from boot. Readding it to boot, didn't fix it. I'm using OpenRC. I tried reinstalling kmod, eudev, openrc, no change... Why this happened? Can someone help?
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5722

PostPosted: Wed Jun 20, 2018 4:53 pm    Post subject: Reply with quote

edit: i'm a derp, don't mind me
_________________
overlay | patches
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.


Last edited by bunder on Wed Jun 20, 2018 6:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6880
Location: almost Mile High in the USA

PostPosted: Wed Jun 20, 2018 5:46 pm    Post subject: Reply with quote

are you sure that you're not trying to modprobe -r a module that's actually being used by the system?

When you lsmod make sure that module has a refcount of 0.

Is there any errors reported in dmesg when the removal fails? bad version of sys-apps/kmod or are you using some other version as part of perhaps busybox?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6555
Location: Saint Amant, Acadiana

PostPosted: Wed Jun 20, 2018 6:13 pm    Post subject: Reply with quote

Is the module unloading enabled in kernel config?
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
satanail
n00b
n00b


Joined: 18 Feb 2018
Posts: 6

PostPosted: Wed Jun 20, 2018 9:33 pm    Post subject: Reply with quote

Jaglover wrote:
Is the module unloading enabled in kernel config?

Code:
$ cat /usr/src/linux/.config | grep -i load=
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y


eccerr0r wrote:
are you sure that you're not trying to modprobe -r a module that's actually being used by the system?
When you lsmod make sure that module has a refcount of 0.

The module isn't used by anything, it has refcount of 0, and when it is used, it spits out error saying module in use.

eccerr0r wrote:
Is there any errors reported in dmesg when the removal fails? bad version of sys-apps/kmod or are you using some other version as part of perhaps busybox?


No errors in dmesg, I checked before posting, but I couldn't describe the problem better :/

I was using stable openrc and kmod before, switched to ~amd64, still the problem persists. Downgrading to stable doesn't help either :/

Only thing I did may of broken this is I disabled modules service. "rc-update del modules boot", but this only disables auto-loading modules(in my case virtualbox modules), so what that has to do with loading/inserting modules manually? I added it back, but the issue persists. I always generate initramfs with
Code:
genkernel --luks --zfs initramfs
, because I'm using zfs on luks and it never broke inserting/removing modules. Same use flags for kmod,eudev, both stable and ~amd64, fixed nothing. 1 strange this is I don't have 'modules' listed in rc-status
Code:

Runlevel: default
 wpa_supplicant                                                                   [  started  ]
 acpid                                                                            [  started  ]
 alsasound                                                                        [  started  ]
 cronie                                                                           [  started  ]
 dbus                                                                             [  started  ]
 iptables                                                                         [  started  ]
 dhcpcd                                                                           [  started  ]
 local                                                                            [  started  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
Dynamic Runlevel: manual

I used to have modules listed in there as well. I checked if 'modules' is started, it says it is, but isn't listed in there. Maybe that's the prob? But how so, when looking at the source all it does is auto-loading modules if defined in a conf file... Any ideas?

EDIT: modules service works, because it loads my bbswitch.conf and virtualbox.conf successfully

[Moderator edit: added [code] tags to preserve output layout; changed [quote] tags to [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6880
Location: almost Mile High in the USA

PostPosted: Wed Jun 20, 2018 10:10 pm    Post subject: Reply with quote

Allright, a derp guess that Bunder may have implied: Is sudo actually getting you root access? (It is possible for sudo to give another user privileges, not just root, so I had to ask...)

The modules service should simply enable kmod to autoload modules, but you should be able to do them manually, which is weird... hmm. Also can you load new modules?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
satanail
n00b
n00b


Joined: 18 Feb 2018
Posts: 6

PostPosted: Wed Jun 20, 2018 10:30 pm    Post subject: Reply with quote

eccerr0r wrote:
Allright, a derp guess that Bunder may have implied: Is sudo actually getting you root access? (It is possible for sudo to give another user privileges, not just root, so I had to ask...)

The modules service should simply enable kmod to autoload modules, but you should be able to do them manually, which is weird... hmm. Also can you load new modules?


Nope.. can't insert new modules as well. I tested creating dirs, files, removing, editing with sudo and works perfectly. Sudoing modprobe and login in as root, both give out "operation not permitted"

I also tried downgrading to a previously known kernel - still the same, so it's not the kernel.
Tried to get rid of initramfs - it's not the problem again.

I'm using: sys-fs/eudev-3.2.5 hwdb kmod
sys-apps/kmod-25 python_targets2_7 python_targets3_6 tools zlib

EDIT: I got really frustrated, found backup from 4-5 months ago, I deleted my current /etc and placed /etc from the backup. Inserting/removing modules works perfect now. I still don't know what happened, as I didn't even touch etc in the first place lol, you can mark it as solved... thanks everyone for trying to help!
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 606

PostPosted: Thu Jun 21, 2018 12:32 am    Post subject: Reply with quote

The 'modprobe' binary may have been trying to access or modify a file and ran into a permissions issue.
Back to top
View user's profile Send private message
Marcih
Tux's lil' helper
Tux's lil' helper


Joined: 19 Feb 2018
Posts: 109

PostPosted: Thu Jun 21, 2018 2:43 pm    Post subject: Reply with quote

satanail wrote:
I got really frustrated, found backup from 4-5 months ago, I deleted my current /etc and placed /etc from the backup. Inserting/removing modules works perfect now. I still don't know what happened, as I didn't even touch etc in the first place lol, you can mark it as solved... thanks everyone for trying to help!

It would've been helpful to diff all the files, see which ones were changed and find the culprit. Then again, I don't think diff takes file permissions into account, only the contents... Did you back up the non-working /etc?
_________________
Bones McCracker wrote:
It wouldn't be so bad, if it didn't suck.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 6880
Location: almost Mile High in the USA

PostPosted: Thu Jun 21, 2018 3:32 pm    Post subject: Reply with quote

Might be extended attributes too, weird.

Mystery... hate unsolved mysteries, but looks like this may never be solved...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6855

PostPosted: Fri Jun 22, 2018 11:00 am    Post subject: Reply with quote

satanail wrote:
eccerr0r wrote:
are you sure that you're not trying to modprobe -r a module that's actually being used by the system?
When you lsmod make sure that module has a refcount of 0.

The module isn't used by anything, it has refcount of 0, and when it is used, it spits out error saying module in use.

The ref count is not a proof of usage, it's a proof of dependency using it: at 0 ref count, it just mean no other module use it.
Also, the ref count, even at 0 doesn't mean the module is not use, you could have a module "bork" handling harware "bork hw" and in use (the bork hw is working making the module in use), and again, still a 0 ref count, because no other module refer to "bork module"

And it's pretty easy to see that
run some X11 with nvidia-driver, and try to remove the nvidia module
stop x11 (to release the card usage), and you will be able to remove nvidia module this time.

that's not about the error user is getting because it's clearly permissions issue, but while i'm generally interest in mystery, i must say i'm really less interest in a mystery about a user having permissions issue while using sudo.
Back to top
View user's profile Send private message
satanail
n00b
n00b


Joined: 18 Feb 2018
Posts: 6

PostPosted: Sat Jun 23, 2018 8:38 pm    Post subject: Reply with quote

krinn wrote:
satanail wrote:
eccerr0r wrote:
are you sure that you're not trying to modprobe -r a module that's actually being used by the system?
When you lsmod make sure that module has a refcount of 0.

The module isn't used by anything, it has refcount of 0, and when it is used, it spits out error saying module in use.

The ref count is not a proof of usage, it's a proof of dependency using it: at 0 ref count, it just mean no other module use it.
Also, the ref count, even at 0 doesn't mean the module is not use, you could have a module "bork" handling harware "bork hw" and in use (the bork hw is working making the module in use), and again, still a 0 ref count, because no other module refer to "bork module"

And it's pretty easy to see that
run some X11 with nvidia-driver, and try to remove the nvidia module
stop x11 (to release the card usage), and you will be able to remove nvidia module this time.

that's not about the error user is getting because it's clearly permissions issue, but while i'm generally interest in mystery, i must say i'm really less interest in a mystery about a user having permissions issue while using sudo.


It's not only sudo, you haven't read the thread I guess, it's the same as if I login as root, but whatever. I thought I deleted my old /etc, but I've put my setup on a VM, so I could test faster, and my old /etc is still there, so when I have time for this I'll definately find out what caused it and I'll report back, even if nobody cares, it'll eventually happen to someone else and he'll come to this thread.
Back to top
View user's profile Send private message
Syl20
Guru
Guru


Joined: 04 Aug 2005
Posts: 502
Location: France

PostPosted: Wed Jun 27, 2018 4:09 pm    Post subject: Reply with quote

Perhaps you accidentally set the "modules_disabled" kernel parameter on, in sysctl.conf ? Once this parameter set, modules loading or unloading is permanently forbidden, until the next reboot (you can't unset it).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum