I can not get nfs to work in Centos 7

Issues related to applications and software problems
Post Reply
Bigtwin
Posts: 32
Joined: 2012/05/11 08:48:32

I can not get nfs to work in Centos 7

Post by Bigtwin » 2014/07/14 19:56:52

I am trying to configure my NAS, which I recently installed to Centos 7 (fresh install, no upgrade)

Now I have this disks, which I export, but I can not mount them on my laptop.

The laptop does not come back with a prompt, when I enter a mount command.

Anyone an idea what could be the problem? The syslog/messages file do not give any hint.

Besides, what are the correct Centos7 commands for "service nfs (re)start" and "chkconfig nfs on" ?

Showmount on my laptop says:
showmount -e <servername> clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)

But I can ping the servername.

No firewall, not on the laptop, nor on the server.

Code: Select all

root@<servername> > exportfs
/media/disk1  	ip range/24
/media/disk2  	ip range/24
/media/disk3  	ip range/24
/media/disk4  	ip range/24
/media/disk5  	ip range/24
/media/disk6  	ip range/24

root@<servername> > systemctl list-units | grep nfs
proc-fs-nfsd.mount			loaded active mounted	RPC Pipe File System
var-lib-nfs-rpc_pipefs.mount		loaded active mounted	RPC Pipe File System
nfs-idmap.service			loaded active running		NFSv4 ID-name mapping daemon
nfs-lock.service			loaded active running		NFS file locking service.
nfs-mountd.service			loaded active running		NFS Mount Daemon
nfs-rquotad.service			loaded active running		NFS Remote Quota Server
nfs-server.service			loaded active exited		NFS Server
nfs.target				loaded active active		Network File System Server

root@<servername> > systemctl list-unit-files | grep nfs
proc-fs-nfsd.mount			static  
var-lib-nfs-rpc_pipefs.mount		static  
nfs-blkmap.service			disabled
nfs-idmap.service			disabled
nfs-lock.service			enabled 
nfs-mountd.service			enabled 
nfs-rquotad.service			enabled 
nfs-secure-server.service		disabled
nfs-secure.service			disabled
nfs-server.service			enabled 
nfs.service				disabled
nfslock.service			disabled
nfs.target				enabled 
After systemctl start nfs.service the service stays disabled.

Sorry that the layout, with tabs, is not preserved, when submitting this text...

User avatar
toracat
Forum Moderator
Posts: 7380
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: I can not get nfs to work in Centos 7

Post by toracat » 2014/07/14 22:11:21

To start a service,

# systemctl start nfs-server.service

To see the status,

# systemctl status nfs-server.service

If that does not work, check /var/log/messages for any hint.
CentOS Forum FAQ

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: I can not get nfs to work in Centos 7

Post by Super Jamie » 2014/07/15 06:48:49

Have you allowed the NFS ports in the firewall?

If you're using NFSv3 you'll need to hard-set the daemon port numbers in /etc/sysconfig/nfs. NFSv4 only needs TCP 2049.

Also you can enable NFS on startup with systemctl enable nfs.service

Bigtwin
Posts: 32
Joined: 2012/05/11 08:48:32

Re: I can not get nfs to work in Centos 7

Post by Bigtwin » 2014/07/16 18:22:47

I have no firewall running, while getting nfs to work. No hints in messages, no clue, after several days of searching and trying.

I am going back to good ole 6.5 and will try again in half a year, or so, when version 7 is more commonly used.

Thanks all, for trying to help...

rondayvudo
Posts: 1
Joined: 2014/07/17 18:17:49

Re: I can not get nfs to work in Centos 7

Post by rondayvudo » 2014/07/17 18:19:51

For some reason, I got the same error you got until I enabled nfs-mountd.service. After that, my clients could see the share.

Bigtwin
Posts: 32
Joined: 2012/05/11 08:48:32

Re: I can not get nfs to work in Centos 7

Post by Bigtwin » 2014/08/12 15:09:33

I'm back on Centos 7.

I did disable iptables in a try to solve this problem, that didn't help.

Later I read about firewalld...

Disabled firewalld too, bingo. NFS works again.

So I did disable iptables, assuming there was no firewall active anymore, but still couldn't connect my nfs shares. After disabling firewalld too, it worked.

So now I have to configure iptables of firewalld to grant nfs connections. Anyone a suggestion on how to configure firewalld? Or should I just use only iptables?

Is there a page, that describes all this new stuff in Centos 7 ? To get i all going more smoothly?

bertan
Posts: 55
Joined: 2014/01/12 23:43:19
Location: Canada

Re: I can not get nfs to work in Centos 7

Post by bertan » 2014/08/12 15:39:13

You can read my notes on NFS and CentOS 7 if you like: http://members.shaw.ca/bertan/set-up-nf ... tos-7.html

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: I can not get nfs to work in Centos 7

Post by Super Jamie » 2014/08/12 15:49:25

Think of FirewallD as a state machine for iptables. If you're using FirewallD, control the firewall through FirewallD, not through iptables directly.

The upstream documentation is pretty good for the most part, especially the new Networking Guide:

https://access.redhat.com/documentation ... index.html

If you're using pure NFSv4, all you need is TCP 2049. If you're still using NFSv3, the Security Guide explains how to set each daemon to a static port, you'd then need to allow each of those ports in.

https://access.redhat.com/documentation ... curing_NFS

Post Reply

Return to “CentOS 7 - Software Support”