I need to load the drbd module on my CentOS server at boot time. I know a module can be loaded without the need of a restart using modprobe drbd but of course after a system reboot I would have to load it again manually. I came across Persistent Module Loading and it says

Kernel modules are usually loaded directly by the facility that requires them, which is given correct settings in the /etc/modprobe.conf file.

I don't have the conf file, just the /etc/modprobe.d/ directory.

Next it says:

Red Hat Enterprise Linux checks for the existence of the /etc/rc.modules file at boot time, which contains various commands to load modules.

So not sure whether this applies only to RHEL or CentOS as well (it's CentOS documentation) but /etc/rc.moduleswas missing as well.

After executing:

# echo modprobe foo >> /etc/rc.modules 
# chmod +x /etc/rc.modules

I can see the drbd module being loaded even after a reboot:

enter image description here

Is it ok how I did it ? Second question - the CentOS 7 OS I'm using is for testing purposes - the production system will run on RHEL 7. Would I still apply the same steps to load the module at boot?

Thank you in advance!


I'm loading needed modules at boot, after creating a file xxx.conf in /etc/modules-load.d/ , where xxx.conf is free-form file name and the content of the file is in form :



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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