nfs modules won't load on boot

Issues related to configuring your network
Post Reply
KernelOops
Posts: 39
Joined: 2013/12/18 15:04:03

nfs modules won't load on boot

Post by KernelOops » 2019/01/06 00:39:07

Hello everyone,

I would like to mount a single NFS share on a CentOS 7 server. At first I noticed that the mount command failed with the following error:

Code: Select all

mount.nfs: No such device
This is mostly due to the nfs modules not being loaded or if they are not available (kernel not compiled with nfs, etc). At first I tried to modprobe nfs but the module did not load... strange. Eventually, I could only load the required modules by running instmod directly on the module files:

Code: Select all

# insmod /lib/modules/3.10.0-957.1.3.el7.x86_64/kernel/fs/nfs/nfs.ko.xz 
# insmod /lib/modules/3.10.0-957.1.3.el7.x86_64/kernel/fs/nfs/nfsv4.ko.xz 
Now my mount command works fine. But, loading shares from the /etc/fstab fails because those modules don't load on boot, so how would I force the nfs modules to load on boot?

Thank you.

User avatar
TrevorH
Forum Moderator
Posts: 24775
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: nfs modules won't load on boot

Post by TrevorH » 2019/01/06 00:44:52

What's the output from rpm -V kernel-3.10.0-957.1.3.el7.x86_64 ?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

KernelOops
Posts: 39
Joined: 2013/12/18 15:04:03

Re: nfs modules won't load on boot

Post by KernelOops » 2019/01/06 00:48:47

thanks for the quick reply, here is the output:

Code: Select all

# rpm -V kernel-3.10.0-957.1.3.el7.x86_64
.M.......  g /boot/initramfs-3.10.0-957.1.3.el7.x86_64.img
seems like only the initramfs is slightly modified, should be logical.

*edit*

this is a CentOS 7.6.1810 minimal installation, SELinux is enabled and in enforcing mode.

User avatar
TrevorH
Forum Moderator
Posts: 24775
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: nfs modules won't load on boot

Post by TrevorH » 2019/01/06 02:52:03

Is nfs-utils installed?
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

KernelOops
Posts: 39
Joined: 2013/12/18 15:04:03

Re: nfs modules won't load on boot

Post by KernelOops » 2019/01/06 10:22:09

Yes it is. Its one of the packages that I've set to be installed via my ansible playbook:

Code: Select all

# rpm -q nfs-utils
nfs-utils-1.3.0-0.61.el7.x86_64

KernelOops
Posts: 39
Joined: 2013/12/18 15:04:03

Re: nfs modules won't load on boot

Post by KernelOops » 2019/01/13 12:43:32

*update*

I've found the cause of the problem. Apparently, *something* installed a blacklist file under /etc/modprobe.d/ which prevented nfs from loading automatically.

Post Reply