45

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?

4
  • 1
    Hi, thanks for you first question. It would be nice if you could mention which linux distribution you're referring to :) Apr 3, 2013 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, 2013 at 19:59
  • (Also, deleted my own answer because it is not fedora-specific) Apr 3, 2013 at 20:49
  • @BonsiScott, your answer could well be useful for others...
    – vonbrand
    Apr 3, 2013 at 21:57

2 Answers 2

66

On any 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.

4
9

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.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .