Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My distribution is Fedora 17 Gnome. Every time I reboot/restart my computer I need to run this command as root:

modprobe rt2800usb

How can I make it permanent?

share|improve this question
1  
Hi, thanks for you first question. It would be nice if you could mention which linux distribution you're referring to :) –  Bonsi Scott Apr 3 '13 at 19:53
1  
@BonsiScott The distribution should probably be added to the question text, as well, but the tag says Fedora. –  depquid Apr 3 '13 at 19:59
    
Thanks -didn't see that one. ;) –  Bonsi Scott Apr 3 '13 at 20:01
    
(Also, deleted my own answer because it is not fedora-specific) –  Bonsi Scott Apr 3 '13 at 20:49
    
@BonsiScott, your answer could well be useful for others... –  vonbrand Apr 3 '13 at 21:57

2 Answers 2

up vote 6 down vote accepted

If you're on fedora (or any other distro using systemd) you can automatically load the module via modules-load.d:

  • create the config file:

    /etc/modules-load.d/rt2800usb.conf

  • open it and edit like this (add the module name):

    rt2800usb

  • next time you reboot the module should be automatically loaded


Troubleshooting:

Check if systemd service loaded the module:

systemctl status systemd-modules-load.service

The output should look like this:

systemd-modules-load.service - Load Kernel Modules
  Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
  Active: active (exited) since Wed, 03 Apr 2013 22:50:57 +0000; 46s ago
        Docs: man:systemd-modules-load.service(8)
              man:modules-load.d(5)
 Process: 260 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=0/SUCCESS)

The last line contains the PID (process id) and the exit code. status=0/SUCCESS means the module was successfully inserted, confirmed by:

journalctl -b _PID=260

output being:

Apr 03 22:50:57 mxhst systemd-modules-load[260]: Inserted module 'rt2800usb'

In case of failure, systemctl output looks like this:

systemd-modules-load.service - Load Kernel Modules
  Loaded: loaded (/usr/lib/systemd/system/systemd-modules-load.service; static)
  Active: failed (Result: exit-code) since Wed, 03 Apr 2013 22:50:59 +0000; 43s ago
        Docs: man:systemd-modules-load.service(8)
              man:modules-load.d(5)
 Process: 260 ExecStart=/usr/lib/systemd/systemd-modules-load (code=exited, status=1/FAILURE)

with journalctl -b reporting:

Apr 03 22:50:59 mxhst systemd-modules-load[260]: Failed to find module 'fakert2800usb'

When the exit code is 0/SUCCESS it means your module has been successfully inserted; running

lsmod | grep rt2800

should confirm that:

rt2800usb              26854  0 
rt2x00usb              19757  1 rt2800usb
rt2800lib              64762  1 rt2800usb
rt2x00lib              66520  3 rt2x00usb,rt2800lib,rt2800usb
mac80211              578735  3 rt2x00lib,rt2x00usb,rt2800lib

If lsmod output doesn't confirm (despite the service exit code being 0/SUCCESS) it means something removed the module after being loaded by modules-load.service. One possible cause is another *.conf file that blacklisted the module. Look for a line like:

blacklist rt2800usb

in /etc/modprobe.d/*.conf, /usr/lib/modprobe.d/*.conf or /run/modprobe.d/*.conf and comment it out / delete it.

share|improve this answer
    
I've done this, but the module didn't load on reboot. –  somethingSomething Apr 3 '13 at 21:45
    
Is it because root is the owner of the file? –  somethingSomething Apr 3 '13 at 21:47
    
When I reboot, I still have to do the modprbe command. Isn't it listed because the listing is after I ran the modprobe command? –  somethingSomething Apr 3 '13 at 22:49
    
@somethingSomething - see my updated answer –  don_crissti Apr 4 '13 at 13:15
    
|Thanks a bunch. –  somethingSomething Apr 4 '13 at 21:31

To load a module on boot, you create a file in /etc/modules-load.d/; this file can have any name, but must end in .conf. In the case of your wifi driver, you could for example create the file /etc/modules-load.d/rt2800.conf.

In the file, add a single line with the name of the module you want to load like so:

rt2800usb

The Arch Wiki page on Kernel modules has more information.

share|improve this answer
    
Thanks for the help –  somethingSomething Apr 4 '13 at 21:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.