Mounting remote share through nfs

Issues related to configuring your network
nitinkumar
Posts: 17
Joined: 2020/04/29 04:07:16

Mounting remote share through nfs

Post by nitinkumar » 2020/05/16 09:55:28

I need a help in debugging the following problem.

1) I am trying to mount a share on my centOS 7 Virtual machine from Red hat enterprise server 6 ( an old one indeed !!!)

2) I am doing the following:-
Server IP address is 192.168.29.103
CentOS 7 VM client configured in bridge mode IP address is 192.168.29.72
Both machines are pinging.
NFS package is installed including nfs-utils on both RHEL 6 server as well as on CentOS 7 VM.
NFS is running on both the machine. "Service status nfs " command run on both the machines give output as "nfs activated (exited)" which
is highlighted in green color. this message is given along with other sentences indicating that nfs is properly enabled and running.

3) I am doing following things on RHEL 6 Server.
logging as root user.
# mkdir mountpoint
# chmod 755 mountpoint
# vi /etc/exports
/mountpoint 192.168.29.72(rw,sync) ------> mount directory "mountpoint" on client 192.168.29.72
save and exit.
NFS service restarted. system-config nfs restart <return>
check whether service restarted by checking "service status nfs". No error, green highlighted message "nfs activated (exited)" appears along with other sentences.

4) I am doing following things on CentOS7 client
logging as root user.
# mkdir /nitin
nfs is already running. Now i am trying to mount /mountpoint from server 192.168.29.103 on my directory /nitin
# mount -t nfs 192.168.29.103:/mountpoint /nitin < return>

HERE I AM GETTING ERROR "mount.nfs: no root to server".

In order to debug this problem I have disabled firewall on both the machines. Tried different ways but no success. /var/log/messages report no error.

Can anybody help me to find out what is the problem? What is the meaning of the message "nfs activated (exited)" ??

User avatar
jlehtone
Posts: 3183
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/16 13:37:31

man exports wrote:fsid=num|root|uuid
NFS needs to be able to identify each filesystem that it exports. Normally it will use a UUID for the filesystem (if the filesystem has such a thing) or the device number of the device holding the filesystem (if the filesystem is stored on the device).
As not all filesystems are stored on devices, and not all filesystems have UUIDs, it is sometimes necessary to explicitly tell NFS how to identify a filesystem. This is done with the fsid= option.
For NFSv4, there is a distinguished filesystem which is the root of all exported filesystem. This is specified with fsid=root or fsid=0 both of which mean exactly the same thing.
Add that ot /etc/exports:

Code: Select all

/mountpoint 192.168.29.72(rw,sync,fsid=root)
and then

Code: Select all

# exportfs -rv
On client, I would try first:

Code: Select all

# mount -t nfs 192.168.29.103:/ /nitin
Furthemore, I would set autofs.service to mount for production.

nitinkumar
Posts: 17
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/17 09:09:30

when I do the changes as told on the RHEL 6 Server, i get following error -----

exportfs: /etc/exports : 2 : bad fsid "fsid=root"

User avatar
jlehtone
Posts: 3183
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/17 09:22:37

The man exports that I did quote was from online. Hence not from RHEL 6.
However, it did write: "specified with fsid=root or fsid=0".

Interestingly, man exports of CentOS 6 says the same, so "root" should be a valid value. Is your server up to date?

If root fails, then try the 0.

nitinkumar
Posts: 17
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/17 09:45:32

yes. fsid=0 works. it gives output on server as "exporting 192.168.29.72:/mountpoint"

I think here is a mistake in /etc/exports file. 192.168.29.72 is client ip address and /mountpoint is server side share.

and still I get error "mount:nfs no root for server"

nitinkumar
Posts: 17
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/17 11:03:51

Yes. "fsid=0" works and i get message on server as "exporting 192.168.29.72/mountpoint" where 192.168.29.72 is client ip address and /mountpoint
is a server side share.

but error "mount.nfs: no route to host" persists.

/etc/exports entry is ----> /mountpoint 192.168.29.72(rw,sync,fsid=0)

After getting error message i even tried server address 192.168.29.103 in /etc/exports file, restart nfs service, but the error "no root to host"
still exists.

User avatar
jlehtone
Posts: 3183
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Mounting remote share through nfs

Post by jlehtone » 2020/05/17 15:50:00

nitinkumar wrote:
2020/05/17 11:03:51
"no route to host"
"no root to host"
Those are two very different strings. If it really is "no route to host", then problem is in network configuration.

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

Re: Mounting remote share through nfs

Post by TrevorH » 2020/05/17 21:01:42

If it's any use, no route to host is what you get when you hit the last iptables rule in the default set, that gives a -j REJECT.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

nitinkumar
Posts: 17
Joined: 2020/04/29 04:07:16

Re: Mounting remote share through nfs

Post by nitinkumar » 2020/05/18 10:11:29

This looks to be a firewall issue because "mount.nfs: no route to host" message comes after about 180 -200 seconds after the mount command is given.

Now I want to know how to modify iptables to solve this issue ? I am using CentOS 7- Minimal.

MartinR
Posts: 620
Joined: 2015/05/11 07:53:27
Location: UK

Re: Mounting remote share through nfs

Post by MartinR » 2020/05/18 10:27:29

From my notes:

Network is unreachable

Don't believe this automatically, it may be due to the order in which IPv4 and IPv6 are tried. Diagnose as follows:

# mount -t nfs4 tamar.home:/inst /inst -v
mount.nfs4: timeout set for Mon Mar 6 18:37:07 2017
mount.nfs4: trying text-based options 'addr=192.168.63.213,clientaddr=192.168.63.172'
mount.nfs4: mount(2): Connection refused
mount.nfs4: trying text-based options 'addr=fdcf:48d:554d:3f::d5,clientaddr=::'
mount.nfs4: mount(2): Network is unreachable
mount.nfs4: Network is unreachable

Post Reply

Return to “CentOS 7 - Networking Support”