[SOLVED] Using NFS to connect 2 solydK 10 machines

Questions about networking.
In the Original Post please also include the output of inxi -FNzxx
SolydForEver
Posts: 357
Joined: 13 Oct 2014 05:25
Location: East part of The Netherlands

[SOLVED] Using NFS to connect 2 solydK 10 machines

Postby SolydForEver » 28 Dec 2019 10:07

Hi all,

I have 2 machines here which I want to connect to eachother over the network using NFS, since they are both Linux machines.
On the internet I found several manuals how to do that but not one gives me a good result, I've been busy for several days now and it doesn't work.

What I did is this:

machines 1 and 2:
Firewall: added nfs service to it which opens port 2049, also had the firewall off

Set fixed IP-address: 192.168.2.8 and 192.168.2.9 (below written as 192.168.2.x for both machines)

Installed nfs-kernel-server, nfs-common and rpcbind

Added rpcbind mountd nfsd statd lockd rquotad: ALL to /etc/hosts.deny

Added: rpcbind mountd nfsd statd lockd rquotad: 127.0.0.1 192.168.2.x to /etc/hosts.allow

Added: /home/username 192.168.2.x(rw,sync.no_subtree_check) to /etc/exports

Added: 192.168.2.x:/home/username /mnt/username nfs users/rw/hard/intr/noauto,noexec 0 0 to /etc/fstab

In /etc/defaul/nfs-common I wrote: NEED_GSSD="no"

In /etc/default/nfs-kernel-server I wrote NEED_SVFGSSD="no"

Then I started the nfs-kernel-server by means of: systemctl enable nfs-kernel-server and systemctl start nfs-kernel-server (as root of course)

I mounted the new fstab with: mount -a

In Dolphin, when I open the /mnt folder, after a while I will see the folder username but when trying to open it, I get the message that the folder does not exist

Can somebody tell me what I do wrong? It all sounds logical to me what I have done but it doesn't work.

SolydForEver
Posts: 357
Joined: 13 Oct 2014 05:25
Location: East part of The Netherlands

Re: Using NFS to connect 2 solydK 10 machines

Postby SolydForEver » 03 Jan 2020 17:31

I can mark this post as solved. I found out how to use NFS between 2 computers, which if you know it, is very simple.

Since both computers are client as well as server, both computers need the same settings and extra software:

Code: Select all

install nfs-kernel-server
in /etc/exports you write the name of the partition or folder you want to share with the other computer and the name of the other computer which may see the contents:
<folder-toshare>        <name (or ip) of other computer>(rw,sync,no_subtree-check)

Since both computers are switched off I chose not to use an extra line in fstab but I used autofs to mount the shared folder:
install autofs

in /etc/auto.master I wrote:
/mnt  /etc/auto.shares --timeout=10 --ghost

in /etc/auto.shares I wrote:
<shared-folder-name>  -fstype=nfs,rw,soft,retry=0 <ip-address of other server>:/<name-of shared-folder>

sudo systemctl enable autofs
sudo systemctl start autofs

sudo systemctl enable nfs-kernel-server
sudo systemctl start nfs-kernel-server
Don't use the <> signs but instead type the name of the folder or the ip-address

That's all.


Return to “Networking”

Who is online

Users browsing this forum: No registered users and 2 guests