# NFS backup target (localhost)

**URL:** <https://forums.suse.com/t/nfs-backup-target-localhost/17699>\
**Category:** SUSE Storage\
**Created:** [June 11, 2020, 4:17am UTC](https://forums.suse.com/t/nfs-backup-target-localhost/17699 "2020-06-11T04:17:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wopl](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wopl/32/6415_2.png) [@wopl](https://forums.suse.com/u/wopl)\
**Post date:** [June 11, 2020, 4:17am UTC](https://forums.suse.com/t/nfs-backup-target-localhost/17699/1 "2020-06-11T04:17:45Z")

</div>

Setting up NFS target for backup was successful using a separate NFS server.  
I want to change now NFS to my localhost (well, being not best practice, but in my case useful).  
NFS server is running and manual mount via shell is successful (138.201.199.xxx is my localhost).

Changing NFS target in Longhorn shows following:

> 2020-06-11T05:53:27.363339046+02:00 time=“2020-06-11T03:53:27Z” level=error msg=“Error in request: error listing backups: error listing backup volumes: Failed to execute: /var/lib/longhorn/engine-binaries/longhornio-longhorn-engine-v1.0.0/longhorn [backup ls --volume-only nfs://138.201.199.xxx:/longhorn], output Cannot mount nfs 138.201.199.xxx:/longhorn: Failed to execute: mount [-t nfs4 138.201.199.xxx:/longhorn /var/lib/longhorn-backupstore-mounts/138\_201\_199\_xxx/longhorn], output mount.nfs4: access denied by server while mounting 138.201.199.xxx:/longhorn\n, error exit status 32\n, stderr, time="2020-06-11T03:53:27Z" level=error msg="Cannot mount nfs 138.201.199.xxx:/longhorn: Failed to execute: mount [-t nfs4 138.201.199.xxx:/longhorn /var/lib/longhorn-backupstore-mounts/138\_201\_199\_xxx/longhorn], output mount.nfs4: access denied by server while mounting 138.201.199.xxx:/longhorn\n, error exit status 32"\n, error exit status 1”

I checked many times and could not find the issue.

> /var/lib/longhorn-backupstore-mounts/138\_201\_199\_xxx/longhorn

exists and has all permissions. Any idea from your side?

---

<div class="post-metadata">

**Author:** ![yasker](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/yasker/32/137_2.png) [@yasker](https://forums.suse.com/u/yasker)\
**Post date:** [June 12, 2020, 2:37am UTC](https://forums.suse.com/t/nfs-backup-target-localhost/17699/2 "2020-06-12T02:37:00Z")

</div>

It sounds like your NFS server has some kind of access control set up. Can you try to run the same mount command inside `longhorn-manager` pod? It should be easier to debug in that way.

Also, make sure your NFS server supports NFSv4. Longhorn doesn’t support NFSv3.

---

<div class="post-metadata">

**Author:** ![wopl](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/wopl/32/6415_2.png) [@wopl](https://forums.suse.com/u/wopl)\
**Post date:** [June 12, 2020, 3:43am UTC](https://forums.suse.com/t/nfs-backup-target-localhost/17699/3 "2020-06-12T03:43:56Z")

</div>

Yes, always on NFSv4.  
As said: mount within my node works well. If target is another node, as well no problems.  
From within longhorn-manager pod I have the same result: no success.

First try set /etc/exports to (as it works with another target node):

> /srv/nfsv4/ 138.201.199.xxx/32(rw,sync,root\_squash,no\_subtree\_check,fsid=0)  
> /srv/nfsv4/longhorn 138.201.199.xxx/32(rw,sync,root\_squash,no\_subtree\_check)

will result (within longhorn-manager) in:

> mount -v -t nfs4 138.201.199.xxx:/longhorn ./longhorn  
> mount.nfs4: timeout set for Fri Jun 12 03:20:56 2020  
> mount.nfs4: trying text-based options ‘vers=4.2,addr=138.201.199.xxx,clientaddr=10.42.0.zzz’  
> mount.nfs4: mount(2): Permission denied  
> mount.nfs4: access denied by server while mounting 138.201.199.xxx:/longhorn

Then I added into /etc/exports longhorn-manager pod IP:

> /srv/nfsv4/ 138.201.199.xxx/32(rw,sync,root\_squash,no\_subtree\_check,fsid=0)  
> /srv/nfsv4/longhorn 138.201.199.xxx/32(rw,sync,root\_squash,no\_subtree\_check)  
> /srv/nfsv4/longhorn 10.42.0.zzz/32(rw,sync,root\_squash,no\_subtree\_check)

Slightly different result:

> mount -v -t nfs4 138.201.199.xxx:/longhorn ./longhorn  
> mount.nfs4: timeout set for Fri Jun 12 03:23:33 2020  
> mount.nfs4: trying text-based options ‘vers=4.2,addr=138.201.199.xxx,clientaddr=10.42.0.yyy’  
> mount.nfs4: mount(2): No such file or directory  
> /usr/sbin/start-statd: 23: /usr/sbin/start-statd: systemctl: not found  
> mount.nfs4: trying text-based options ‘addr=138.201.199.xxx’  
> mount.nfs4: prog 100003, trying vers=3, prot=6  
> mount.nfs4: trying 138.201.199.xxx prog 100003 vers 3 prot TCP port 2049  
> mount.nfs4: prog 100005, trying vers=3, prot=17  
> mount.nfs4: trying 138.201.199.xxx prog 100005 vers 3 prot UDP port 47256  
> mount.nfs4: mount(2): Permission denied  
> mount.nfs4: access denied by server while mounting 138.201.199.xxx:/longhorn

A port problem between pod and localhost, which is “different” when using another node?  
Using a Bridge, when accessing another node, but not when using localhost?  
Still confusing…

---

<div class="post-metadata">

**Author:** ![panManfredini](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/panmanfredini/32/7057_2.png) [@panManfredini](https://forums.suse.com/u/panManfredini)\
**Post date:** [January 6, 2021, 6:54pm UTC](https://forums.suse.com/t/nfs-backup-target-localhost/17699/4 "2021-01-06T18:54:35Z")

</div>

Hi,  
I hit the same (or very similar) problem.  
In my case the problem was firewall and NFS server access rules. The pods in fact live on the overlayed network, one need to give access to NFS ports also from that network.

My flannel nework is: 10.42.0.0/16 (you may change that)

Add firewall rules on host:

> sudo ufw allow in from 10.42.0.0/16 to any port 2049  
> sudo ufw allow in from 10.42.0.0/16 to any port 111

Add to “/etc/exports” file

> **nfs-dir** 10.42.0.0/16(rw,sync,no\_subtree\_check)

Then restart NFS:

> sudo exportfs -a  
> sudo systemctl restart nfs-kernel-server
