View previous topic :: View next topic |
Author |
Message |
satanail n00b
Joined: 18 Feb 2018 Posts: 21
|
Posted: Wed Jun 20, 2018 2:41 pm Post subject: Can't Insert or remove modules with modprobe |
|
|
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 |
|
|
bunder Bodhisattva
Joined: 10 Apr 2004 Posts: 5934
|
Posted: Wed Jun 20, 2018 4:53 pm Post subject: |
|
|
edit: i'm a derp, don't mind me _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017
Last edited by bunder on Wed Jun 20, 2018 6:14 pm; edited 1 time in total |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9677 Location: almost Mile High in the USA
|
Posted: Wed Jun 20, 2018 5:46 pm Post subject: |
|
|
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/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
Jaglover Watchman
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
|
satanail n00b
Joined: 18 Feb 2018 Posts: 21
|
Posted: Wed Jun 20, 2018 9:33 pm Post subject: |
|
|
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 |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9677 Location: almost Mile High in the USA
|
Posted: Wed Jun 20, 2018 10:10 pm Post subject: |
|
|
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/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
satanail n00b
Joined: 18 Feb 2018 Posts: 21
|
Posted: Wed Jun 20, 2018 10:30 pm Post subject: |
|
|
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 |
|
|
russK l33t
Joined: 27 Jun 2006 Posts: 665
|
Posted: Thu Jun 21, 2018 12:32 am Post subject: |
|
|
The 'modprobe' binary may have been trying to access or modify a file and ran into a permissions issue. |
|
Back to top |
|
|
Marcih Apprentice
Joined: 19 Feb 2018 Posts: 213
|
Posted: Thu Jun 21, 2018 2:43 pm Post subject: |
|
|
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. |
NeddySeagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
|
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9677 Location: almost Mile High in the USA
|
Posted: Thu Jun 21, 2018 3:32 pm Post subject: |
|
|
Might be extended attributes too, weird.
Mystery... hate unsolved mysteries, but looks like this may never be solved... _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Jun 22, 2018 11:00 am Post subject: |
|
|
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 |
|
|
satanail n00b
Joined: 18 Feb 2018 Posts: 21
|
Posted: Sat Jun 23, 2018 8:38 pm Post subject: |
|
|
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 |
|
|
Syl20 l33t
Joined: 04 Aug 2005 Posts: 619 Location: France
|
Posted: Wed Jun 27, 2018 4:09 pm Post subject: |
|
|
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 |
|
|
|
|
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
|
|