NFS Setup

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

NFS Setup

Postby magick_crow » May 5th, '12, 18:49

I have a 2 computers in my home with a router. I want to have the 2 computers share directories using NFS but everything I try ends up not working. How do I do it properly? Do I need to set up a static LAN ip? How? The other computer is a Kubuntu one and it was working when this server was also a Kubuntu but I have upgrade to Mageia and can't get it to work. Can't wait to here the proper way to do it! Thanks.
magick_crow
 
Posts: 1
Joined: May 5th, '12, 18:46

Re: NFS Setup

Postby djennings » May 6th, '12, 18:27

First of all turn off your firewall. You can always turn it back on later

Second put an entry for the other computer in your /etc/hosts table
Code: Select all
xxx.xxx.xxx.xxx          remote_host_name

Third In mageiaControlCentre>NetworkSharing>AccessNFS scan for remote shares. scanning can take a while
After finding remote shares highlight the one you want to connect to and pick a mount point. A mount point under /mnt is traditional.
Select Options and under advanced various add the option soft (I forget why, but I always do)

Now you should be able to press 'Mount' to mount the option. If you do not have /etc/hosts set up correctly this will fail.

When sharing NFS folders in Mageia Control Centre use the option 'secured connection = off'

If you want to do the set up purely on the command line.
My server has in /etc/exports
Code: Select all
/home/derek/Pictures 192.168.1.0/24(root_squash,anonuid=65534,anongid=65534,async,insecure,no_subtree_check,rw)

to export the shares give the command
Code: Select all
exportfs -ra


My client has this line in /etc/fstab
Code: Select all
zero:/home/derek/Pictures /home/derek/Pictures nfs rsize=8192,wsize=8192,nosuid,soft 0 0
where zero is the host name of the server.
On boot the client automatically connects to the server.
User avatar
djennings
 
Posts: 613
Joined: Jun 2nd, '11, 23:51
Location: Wokingham, UK

Re: NFS Setup

Postby wilcal » May 11th, '12, 17:13

djennings wrote:My client has this line in /etc/fstab
Code: Select all
zero:/home/derek/Pictures /home/derek/Pictures nfs rsize=8192,wsize=8192,nosuid,soft 0 0
where zero is the host name of the server.
On boot the client automatically connects to the server.

NFS connections have been somewhat tricky with Mandrake/Mandriva/Mageia.
A number of times over the years we've run into problems. All, as in ALL,
of my experience has been where the NFS server is the same OS
as the NFS client so I can't tell you how a Ubuntu NFS server
will work with a Mageia client.

Do go through the process outlined by djennings above. That may be
successful. But, on occasion it may not. Open all the clients ports
as in turn off the firewall. Also the "zero" outlined in djennings
explanation may not work all the time. What I do is open a terminal,
log in as admin with a "su -", then launch kwrite in admin mode.
Open /etc/fstab and edit the the NFS command to reflect the IP
of the NFS server not the servers name. As follows:

192.168.1.5:/home/derek/Pictures /home/derek/Pictures nfs rsize=8192,wsize=8192,nosuid,soft 0 0

I find this change to work universally. The Mageia 1/2 NFS Server/Client
process presently works just fine. I have a local Mageia 1 server
and my Cauldron/Mageia 2 NFS tests are working just fine as of today.
"DISK BOOT FAILURE - INSERT SYSTEM DISK AND PRESS ENTER"
is my friend
wilcal
 
Posts: 567
Joined: Jun 20th, '11, 02:01
Location: San Diego CA

Re: NFS Setup

Postby djennings » May 12th, '12, 00:11

Also the "zero" outlined in djennings
explanation may not work all the time.


When editing fstab by hand then yes, using the IP address is preferable. However the NFS GUI in MCC **always** writes the fstab file using the host name. My example fstab was written by the GUI. It is the GUI insisting on using the host name that causes so many problems with the MCC NFS GUI.

When the GUI does a search for NFS servers it learns the host name and IP addresses of the servers, and then writes the host name into the fstab file and discards the IP address.
When you then ask the GUI to mount the NFS share it tries to use the hostname to identify the share so causing a DNS lookup which of course will fail in most cases. That is why I emphasised the need to put the server host name in /etc/hosts so DNS can find it and then the GUI works.

It is a pity that the GUI does not try doing a lookup with avahi. Then we could use dynamic IP addresses with NFS.
User avatar
djennings
 
Posts: 613
Joined: Jun 2nd, '11, 23:51
Location: Wokingham, UK

Re: NFS Setup

Postby doktor5000 » May 14th, '12, 19:41

djennings wrote:It is a pity that the GUI does not try doing a lookup with avahi. Then we could use dynamic IP addresses with NFS.

You should be able to easily adjust this via the hosts key in /etc/nsswitch.conf ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18054
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: NFS Setup

Postby djennings » May 15th, '12, 10:34

doktor5000 wrote:
djennings wrote:It is a pity that the GUI does not try doing a lookup with avahi. Then we could use dynamic IP addresses with NFS.

You should be able to easily adjust this via the hosts key in /etc/nsswitch.conf ...


The resolver already does use avahi. But avahi only resolves names with the domain name .local and diskdrake asks for a lookup without specifying a domain name.
As it happens since writing the last comment I have submitted a patch that does lookups with a .local domain name. See https://bugs.mageia.org/show_bug.cgi?id=207#c36
User avatar
djennings
 
Posts: 613
Joined: Jun 2nd, '11, 23:51
Location: Wokingham, UK


Return to Advanced support

Who is online

Users browsing this forum: No registered users and 1 guest