# NFS Backup - Cannot create mount directory

**URL:** <https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436>\
**Category:** SUSE Storage\
**Created:** [January 31, 2021, 9:34pm UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436 "2021-01-31T21:34:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppcm](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ppcm/32/7162_2.png) [@ppcm](https://forums.suse.com/u/ppcm)\
**Post date:** [January 31, 2021, 9:34pm UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/1 "2021-01-31T21:34:25Z")

</div>

Hello there,

I am trying to configure a backup for my cluster. I use

- Rancher 2.5.5
- Longhorn 1.1.0
- Devices - Raspberry Pi 4
- QNap NAS

I have configurated NFS4 on NAS, added all devices of the cluster and 10.42.0.0/16 for pods in allowed devices  
I tryed to mount the NFS shared folder from each node of the cluster and it works fine

In Longhorn settings, I added  
`nfs://192.168.1.110:/backup_cluster`

Now when I want to create a backup, the following error rise

```auto
fail to backup snapshot: failed to execute: /var/lib/longhorn/engine-binaries/longhornio-longhorn-engine-v1.1.0/longhorn [--url 10.42.0.88:10000 backup create --dest nfs://192.168.1.110:/backup_cluster --label KubernetesStatus={"pvName":"pvc-229542b4-43ff-4b31-ba16-12e36592c273","pvStatus":"Bound","namespace":"remote-access","pvcName":"rdesktop-config","lastPVCRefAt":"","workloadsStatus":[{"podName":"rdesktop-599b9cbf69-79s9x","podStatus":"Running","workloadName":"rdesktop-599b9cbf69","workloadType":"ReplicaSet"}],"lastPodRefAt":""} dbf84ee4-2649-4fc5-aa97-b9891d1a0db4], output , stderr, time="2021-01-31T21:26:03Z" level=info msg="Backing up dbf84ee4-2649-4fc5-aa97-b9891d1a0db4 on tcp://10.42.7.120:10030, to nfs://192.168.1.110:/backup_cluster" time="2021-01-31T21:26:03Z" level=fatal msg="Error running create backup command: failed to create backup to nfs://192.168.1.110:/backup_cluster for volume pvc-229542b4-43ff-4b31-ba16-12e36592c273: rpc error: code = Unknown desc = Cannot create mount directory /var/lib/longhorn-backupstore-mounts/192_168_1_110/backup_cluster for NFS server" , error exit status 1

```

And when I access to Backup session, the following error rise

```auto
error listing backups: error listing backup volumes: Failed to execute: /var/lib/longhorn/engine-binaries/longhornio-longhorn-engine-v1.1.0/longhorn [backup ls --volume-only nfs://192.168.1.110:/backup_cluster], output Cannot create mount directory /var/lib/longhorn-backupstore-mounts/192_168_1_110/backup_cluster for NFS server , stderr, time="2021-01-31T21:28:35Z" level=error msg="Cannot create mount directory /var/lib/longhorn-backupstore-mounts/192_168_1_110/backup_cluster for NFS server" , error exit status 1

```

I tryed to create the folder `/var/lib/longhorn-backupstore-mounts` on each node, it doesn’t help

Any idea what I missed?  
Thanks

---

<div class="post-metadata">

**Author:** ![ppcm](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ppcm/32/7162_2.png) [@ppcm](https://forums.suse.com/u/ppcm)\
**Post date:** [February 5, 2021, 7:32am UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/2 "2021-02-05T07:32:48Z")

</div>

Nobody encounter this problem?

---

<div class="post-metadata">

**Author:** ![PhanLe0110](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/phanle0110/32/7022_2.png) [@PhanLe0110](https://forums.suse.com/u/PhanLe0110)\
**Post date:** [February 6, 2021, 12:07am UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/3 "2021-02-06T00:07:56Z")

</div>

Longhorn try to mount the NFS directory inside the manager pod when listing backups, and inside the instance manager - r pod when creating backups.

Can you exec into the longhorn manager pods (`longhorn-manager-xxxxx`) and longhorn instance manager -r pods (`instance-manager-r-xxxxxxxx`) and try to manually mount the NFS directory?

If you cannot mount it manually then I think that something is wrong with NFS’s setting. Maybe because of permission?

---

<div class="post-metadata">

**Author:** ![ppcm](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/ppcm/32/7162_2.png) [@ppcm](https://forums.suse.com/u/ppcm)\
**Post date:** [February 6, 2021, 10:09am UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/4 "2021-02-06T10:09:00Z")

</div>

Thanks for the answer

I tryed to mount the NFS directory on each `instance-manager-r-xxxxxxxx`, and it works  
I noticed that a new folder was created by Longhorn `backupstore` and inside there is some data

But I have still the same error in the backup section of the UI

```auto
error listing backups: error listing backup volumes: Failed to execute: /var/lib/longhorn/engine-binaries/longhornio-longhorn-engine-v1.1.0/longhorn [backup ls --volume-only nfs://192.168.1.110:/backup_cluster], output Cannot create mount directory /var/lib/longhorn-backupstore-mounts/192_168_1_110/backup_cluster for NFS server , stderr, time="2021-02-06T10:07:54Z" level=error msg="Cannot create mount directory /var/lib/longhorn-backupstore-mounts/192_168_1_110/backup_cluster for NFS server" , error exit status 1

```

---

<div class="post-metadata">

**Author:** ![rsoika](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/rsoika/32/6141_2.png) [@rsoika](https://forums.suse.com/u/rsoika)\
**Post date:** [February 8, 2021, 7:45am UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/5 "2021-02-08T07:45:14Z")

</div>

I have the same issue.

@PhanLe0110 can you give an example how the command to test should look like? I guess it is not a `mkdir` ?  
How can I figure out which of my manager pods/nodes is the one having the problem? Is it the one the volume is attached to or can it be any of the ones a replica resides on?

thanks for help.

---

<div class="post-metadata">

**Author:** ![PhanLe0110](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/phanle0110/32/7022_2.png) [@PhanLe0110](https://forums.suse.com/u/PhanLe0110)\
**Post date:** [February 10, 2021, 9:05am UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/6 "2021-02-10T09:05:47Z")

</div>

@ppcm you can try to create the directory inside Longhorn manager pod `longhorn-manager-xxxxx` to fix the backup listing issue.

But we want to know why Longhorn cannot create the volume automatically. Can you provide us some information as described in [this comment](https://github.com/longhorn/longhorn/issues/2242#issuecomment-776552212) about your environment so we can debug it?

---

<div class="post-metadata">

**Author:** ![PhanLe0110](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/phanle0110/32/7022_2.png) [@PhanLe0110](https://forums.suse.com/u/PhanLe0110)\
**Post date:** [February 10, 2021, 9:06am UTC](https://forums.suse.com/t/nfs-backup-cannot-create-mount-directory/19436/7 "2021-02-10T09:06:45Z")

</div>

@rsoika  
I replied in the GitHub issue [[Question] unable to mount NFS backup · Issue #2242 · longhorn/longhorn · GitHub](https://github.com/longhorn/longhorn/issues/2242#issuecomment-776552212)
