NFS share not visible/mountable

Hello all, I’m new to linux so apologises for any retardation on my part, but im a pretty competent tech user (software engineer by trade) and I’m stuck trying to get an NFS share mounted on another computer.
I go through the seemingly simple Yast GUI to start the server, following a tutorial for OpenSuse I found, and when I go through the yast steps on the computer which is to mount the servers share, I am unable to see the host listed when it scans for nfs servers. I try manually putting in the hostname/ip, but then when it attemtps to mount it says “unable to mount the NFS entries from /etc/fstab/”.
I also cant seem to get remote desktop connecting to the machine either. Perhaps some networking issue? Anyone else had this kind of trouble with NFS/Remote Desktop?
(Also note I’ve spent a few days on this and couldn’t find posts relating to it, if that helps quell any incoming flames…)

Thanks in advance for any and all info/help!

On Tue, 19 Aug 2008 22:56:03 GMT
NitrousUK <NitrousUK@no-mx.forums.opensuse.org> wrote:

>
> Hello all, I’m new to linux so apologises for any retardation on my
> part, but im a pretty competent tech user (software engineer by trade)
> and I’m stuck trying to get an NFS share mounted on another computer.
> I go through the seemingly simple Yast GUI to start the server,
> following a tutorial for OpenSuse I found, and when I go through the
> yast steps on the computer which is to mount the servers share, I am
> unable to see the host listed when it scans for nfs servers. I try
> manually putting in the hostname/ip, but then when it attemtps to mount
> it says “unable to mount the NFS entries from /etc/fstab/”.
> I also cant seem to get remote desktop connecting to the machine
> either. Perhaps some networking issue? Anyone else had this kind of
> trouble with NFS/Remote Desktop?
> (Also note I’ve spent a few days on this and couldn’t find posts
> relating to it, if that helps quell any incoming flames…)
>
> Thanks in advance for any and all info/help!
>
>

Hi! And welcome to OpenSUSE!

Let’s see if I can help you through the NFS issue first… then the Remote
Desktop.

First off, I’m rather old-school… and prefer the command line for things…
since they always work (sometimes I can’t find the menu option for things in
the GUI)

A quick question: Is the firewall running? Can cause issues, and a whole
'nother thread… Either turn them both off, open the respective ports for
NFS… or… well, there is no other option. Be aware that NFS port use is
NOT limited to a few ports, and opening the firewall for NFS involves many
ports.

We’ll try this all from the command line, then work on getting it automated
in yast/fstab and whatnot.

We’re going for working nfs shares here… finesse comes later, right?

I’m going to assume TWO opensuse systems… if you have other OS’s involved,
let me know, we’ll adapt!

We are logged in as root on both systems.

Two computers, SERVER (192.168.1.1) and CLIENT (192.168.1.100), both behind a
working router/firewall… no existing DNS support to resolve SERVER or
CLIENT to their appropriate IP addresses. (the typical setup at home)

==== SERVER has nfs server daemons installed and running
==== CLIENT has nfs client daemons installed and running

==== On SERVER:
Files to be shared are located in /home/nfs, having permissions which
allow user 1000 (usually your account, adjust as needed) to read and play
with files contained within. If you’re not user 1000, replace that number as
appropriate in here) (See Yast-> Users or /etc/passwd to obtain UID/GID)

==== On CLIENT:
We desire files from SERVER to be mounted to /mnt/server

==== On SERVER:
Edit /etc/exports, add the following:
—8<—
/home/nfs *(rw,all_squash,anonuid=1000,anongid=100)
—>8—
save, and then
—8<—
exportfs -va
—>8—
You should see
—8<—
exporting: *:/home/nfs
—>8—
as output. Hooray! That part’s working.
Some explanation for the parts of that line we entered in ‘exports’:

/home/nfs ← what we want to export

  • ← WHO can connect. * means everyone.
    ro ← read only. Could be ‘rw’ for read-write (with permissions)
    all_squash ← don’t care WHO you are, you’re gonna be ‘anon’ who is…
    anonuid ← the UID (user ID) of the user to access this, and…
    anongid ← the GID (group ID) of the user to access this.

Of course, MUCH more information is to be found in the man pages, read
‘man 5 exports’ and ‘man exportfs’ for lots of brain strengthening
goodness.

==== On CLIENT:
We wish to mount the share from SERVER to /mnt/server, which already exists.

Since the DNS isn’t working (yet), we need to identify the server by IP
address…
—8<—
mount -t nfs 192.168.1.1:/home/nfs /mnt/server
—>8—
Of course, there are more options which could be used, but that will work.

You should be able to see and interact with the files in /mnt/server.

There may be permission issues for non-root users, but that’s trivial to fix.

{Chuckle} Now that I think about it, we’ve done most of the work the GUI
would have done… if you open the NFS Server module in Yast-> Network
Services, you’ll see the entry you put into /etc/exports has been parsed and
displayed in the GUI. (Told you cmd-line is easier!) (GUI is nicer though!)

For the client, if one wanted this share to be automounted when the system
boots… then the following line would work in /etc/fstab:

192.168.1.1:/home/nfs /mnt/server nfs defaults 0 0

==============================================

I did say I’d talk about the DNS thing… since most people don’t have a DNS
server in their home network, nor internet wide DNS resolution for their home
networks (I have both… wheee!) then you must resort to other methods to ease
the pain of DNS resolution.

==== On SERVER:
Add the following line to the end of /etc/hosts:

192.168.1.100 CLIENT CLIENT

==== On CLIENT:
Same, but listing SERVER instead.

192.168.1.1 SERVER SERVER

This allows you to refer to SERVER as SERVER instead of 192.168.1.1, and
vice-versa for CLIENT. A royal pain to setup if you have many machines
involved… if you do, ask me, and I’ll show you an easier way with a central
DNS server on one of your machines.

So now, the CLIENT fstab entry could be:

SERVER:/home/nfs /mnt/server nfs defaults 0 0

which is ever so much nicer to read and understand. {Smile}

And again, it’s very easy from the cmd-line… but if you now open the
GUI tool for this (on CLIENT, open the NFS client module), you’ll see how it’s
filled in. (yes, yes… easy to ME, I know)

==============================================

This is a very simple setup, with Read-Only access on the share. If you
change the ‘ro’ to ‘rw’ on SERVER /etc/exports, then you’ve got a shared
resource, and someone with appropriate permissions on CLIENT could
change the data.

The man pages for ‘exports’, ‘exportfs’, ‘mount’ are all VERY informative,
although I do recognize that often it helps to understand a little before you
jump in, so that you can understand the rest.

==============================================

Concerning the Remote Desktop query… How about we get this working, and
then you can ask someone (or me!) your questions for Remote Desktop. I
think I may have overloaded some people reading along… {Smile}

(psst… it might have been firewall related)

(and I think I’m only supposed to answer one question per ticket… remember
‘Dr. Know’ from A.I.?) {Grin}

==============================================

Just a quick re-read of this tome… If I tell the (nfs client) GUI to
‘choose’, I usually get “(Unknown)” back as the server name… if you’ve
added the /etc/hosts names/addresses as shown above, then you can use the
machine’s name, otherwise, supply the IP address as appropriate.

==============================================

Hope this helps

Loni

And yes, this is how I normally answer questions. Ask the guys… I talk too
much. {Smile}


L R Nix
lornix@lornix.com

—8<—

First person to ask me where I found the scissors gets SMACKED!!

—>8—


L R Nix
lornix@lornix.com