NFS Mount zum Proxmox Backup Server - UID/GID Rechte


topaLE
Go to solution Solved by guybrush2012,

Recommended Posts

3 hours ago, mgutt said:

Zur bisherigen Lösung:

Hier fehlt mir der umount bei Array Stop. Ansonsten schreibt proxmox nachher in den RAM von unRAID.

 

 

Warum sollte das passieren. Wenn man den Array stoppt sollten doch Unraid so schlau sein und den NFS Server zu stoppen, dann sind NFS Mounts nicht mehr erreichbar und Proxmox Backup Server kann nicht draufschreiben. Oder stoppt er die nicht? 🤔

In diesem Fall würde ich mit einem Script bei Array Stop den Server Killen 😅

Aber ich bin gleich wieder im dienst. In ca. 14 Stunden bin ich wieder Zuhause 😒

 

Edit: Also ich gehe von einem NAS davon aus, dass er wenn eine HDD Fehlt bzw. in diesem Fall das Share nciht erreichbar ist bzw. gestoppt ist, er den NFS-Server stoppt.

 

 

Edited by guybrush2012
Link to comment
3 minutes ago, guybrush2012 said:

Oder stoppt er die nicht? 🤔

Ich kann es dir nicht sagen was Unraid alles bei einem Array Stop macht, aber warum sollte ein Dienst stoppen, nur weil ein Ordner nicht mehr da ist? NFS an sich kann ja in der Theorie ruhig weiter laufen. SSH und damit SFTP zB geht ja auch weiter, genauso wie rsync. Check das auf jeden Fall mal.

 

Aber wie gesagt würde ich das auf einen Docker auslagern. Dann hat man auch direkt NFS4.

Link to comment
3 minutes ago, mgutt said:

Ich kann es dir nicht sagen was Unraid alles bei einem Array Stop macht, aber warum sollte ein Dienst stoppen, nur weil ein Ordner nicht mehr da ist?


Na weil das jedes NAS so macht ^^
 

Wenn nicht wäre das Fatal. Meine Dreamboxen würden dann bei einem Array Stop weiter im Unraid Flash Aufnehmen 🤨

@topaLE

Könntest du das bitte testen?

Array stoppen und mit PBS im terminal eine Datei Schreiben, z.B.

 

dd if=/dev/zero of=/mnt/pbs bs=1G count=1 oflag=direct 


 

Link to comment
11 minutes ago, guybrush2012 said:

Könntest du das bitte testen?

Array gestoppt.

 

root@pbs:~# dd if=/dev/zero of=/mnt/user/backups bs=1G count=1 oflag=direct
dd: konnte '/mnt/user/backups' nicht öffnen: Datei oder Verzeichnis nicht gefunden


 

  • Like 1
Link to comment
Array gestoppt.
 
root@pbs:~# dd if=/dev/zero of=/mnt/user/backups bs=1G count=1 oflag=directdd: konnte '/mnt/user/backups' nicht öffnen: Datei oder Verzeichnis nicht gefunden


 


Perfekt.

Also ist es so wie ich es dedacht habe. Bei Array Stop wird auch der NFS-Server gestoppt.

Alles andere hätte mich gewundert. Das sind so die Basics die einen NAS können muss

Jetzt richtet du noch die Benachrichtigungen in PBS bzw. Proxmox ein, wann ein Backup Fehlschlägt und hast alles im Griff.

Edit: Im PBS heißt dein Verzeichnis /mnt/user/backups. Nur um sicher zu gehen

Weil eigentlich müsste das Verzeichnis im PBS da sein.

Mach mal bitte ein

df -h


Gesendet von meinem SM-G998B mit Tapatalk



Link to comment
32 minutes ago, guybrush2012 said:

Bei Array Stop wird auch der NFS-Server gestoppt.

Klugscheißermodus: Ich sehe nur, dass /mnt/user/Backups ist nicht mehr da, was logisch ist, weil das Array ja gestoppt wurde.

 

Ich würde es eher so vorschlagen:

 

telnet localhost 2049

 

Wenn NFS aktiv ist, kommt "Connected to localhost" und bei inaktivem NFS "Connection refused".

  • Like 1
Link to comment

Also läuft NFS weiter. Kannst du im gestoppten Zustand über NFS Dateien auf Unraid erstellen?

 

Test-Szenario erstellen, während das Array läuft:

mkdir /mnt/remotes/nfstest
mount -t nfs localhost:/mnt/user/backups /mnt/remotes/nfstest

 

Du musst jetzt den Inhalt vom Backup-Share in dem neuen Ordner sehen können:

ls /mnt/remotes/nfstest

 

Jetzt das Array stoppen.

 

Geht der mount noch?

mountpoint /mnt/remotes/nfstest

 

Wenn ja, versuch einen Unterordner zu erstellen:

mkdir -p /mnt/remotes/nfstest/testdir

 

Kommt ein Fehler? Nein? Dann schau mal nun in den Ordner:

ls /mnt/user/backups

 

Ist das "testdir" da? Dann: A-Karte, Ordner liegt jetzt im RAM

 

Wenn es erstellt wurde: Wieder aufräumen, bevor das Array gestartet wird (oder Server neu starten):

rmdir /mnt/user/backups/testdir
rmdir /mnt/user/backups

 

 

Link to comment

ls /mnt/remotes/nfstest

Sehe Inhalt von mnt/user/backups

 

Array gestoppt:

root@Unraid-NAS-AZ:~# mountpoint /mnt/remotes/nfstest
/mnt/remotes/nfstest is a mountpoint

 

Beim Erstellen vom Unterverzeichnis schmiert mir Unraid ab.

root@Unraid-NAS-AZ:~# mkdir -p /mnt/remotes/nfstest/testdir
^C

 

Hier kann nur abgebrochen werden.


root@Unraid-NAS-AZ:~#
root@Unraid-NAS-AZ:~# ls /mnt/user/backups

 

59 minutes ago, mgutt said:

Ist das "testdir" da? Dann: A-Karte, Ordner liegt jetzt im RAM

Keine Ahnung, Server hängt in der Konsole.

 

Hier stimmen dann die Mountpoints nicht mehr.


/bin/ls: cannot access '/mnt/user/backups': No such file or directory
root@Unraid-NAS-AZ:~#

 

Ich denke aber, das Du recht hast. Der NFS Dienst läuft noch, trotz Array Stopp. Das wäre ja nicht so gut.

Heißt das denn, wenn der Server neu gestartet wird, das ich den Dienst auch nicht beendet?

 

Ist das ein Fehler in Unraid?
 

 

 

Link to comment
1 minute ago, topaLE said:

Heißt das denn, wenn der Server neu gestartet wird, das ich den Dienst auch nicht beendet?

 

Bei einem Shutdown wird immer alles beendet.

 

1 minute ago, topaLE said:

Beim Erstellen vom Unterverzeichnis schmiert mir Unraid ab.

 

Naja, abschmieren und Timeout ist schon was anderes. Warte mal bitte nach dem Array Stop ca 15 Minuten. Eigentlich würde ich erwarten, dass irgendwann mountpoint /mnt/remotes/nfstest zurückgibt, dass der Mount nicht mehr da ist.

 

4 minutes ago, topaLE said:

/bin/ls: cannot access '/mnt/user/backups': No such file or directory

Dann ist eigentlich alles gut. Dh der NFS Server läuft zwar noch, aber der von ihm angebotene Share ist nicht erreichbar. Nicht ideal, aber ich sehe da aktuell keinen Nachteil draus, außer dass Proxmox evtl beim Sichern in ein längeres Timeout laufen könnte.

  • Thanks 1
Link to comment
  • 4 months later...

Sorry to reply in English, I've been reading through the translated thread as I've had the same issues with NFSv4 on Unraid 6.11.5. I could get it to work intermittently by remounting the path manually, but after rebooting the PBS server it would go back to error 13 permission denied. However, I was able to get NFSv3 working reliably in my setup with the following configurations.

 

I adjusted the mount command on my PBS server to force the use of NFSv3:

# <file system> <mount point> <type> <options> <dump> <pass>

unraid.lan:/mnt/user/pbs	/mnt/unraid	nfs	defaults,nfsvers=3	0	0

 

The NFS export in Unraid needs to be set to Private with options similar to these, of course adjusting the CIDR for your network:

192.168.0.0/24(rw,sec=sys,insecure,anongid=34,anonuid=34,all_squash)

Note - I'm not sure if all those options are absolutely necessary, but it seemed to work for me.

 

I also needed to modify ownership of the pbs directory on the Unraid server:

chown -R 34:34 /mnt/user/pbs

 

For me, with all of the above I was able to create a datastore and it persisted a reboot. It's an inelegant solution, and I really wish I could get it to work with NFSv4, but I've spent enough time on this to move on for now.

 

Update:

After playing around with this some more, the good news is that I was able to switch back to NFSv4 with an already created datastore in an Unraid share. I adjusted the NFS export options as follows:

192.168.0.0/24(rw,sec=sys,insecure,anongid=100,anonuid=99,all_squash)

 

Then changed permissions for the PBS share so it's owned by nobody:users (99:100):

chown -R 99:100 /mnt/user/pbs

 

After this I was still able to create new backups and restore old ones from PBS.

 

For reference her's my updated fstab mount entry:

# <file system> <mount point> <type> <options> <dump> <pass>
unraid.lan:/mnt/user/pbs	/mnt/unraid	nfs	defaults	0	0

 

PBS server is working well to both read and write to the datastore, using NFSv4 protocol:

root@pbs01:~# mount | grep unraid
unraid.lan:/mnt/user/pbs on /mnt/unraid type nfs4 (rw,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.xxx,local_lock=none,addr=192.168.0.xxx)

root@pbs01:~# ls -la /mnt/unraid
total 8
drwxrwxrwx 1   99 users     60 Dec 18 13:53 .
drwxr-xr-x 5 root root    4096 Dec 18 20:50 ..
drwxr-x--- 1   99 users 524288 Dec  8 12:33 .chunks
drwxr-xr-x 1   99 users     48 Dec 18 14:00 ct
-rw-r--r-- 1   99 users    297 Dec 18 00:01 .gc-status
drwxr-xr-x 1   99 users     54 Dec 18 14:00 host
-rw-r--r-- 1   99 users      0 Dec  8 12:25 .lock
drwxr-xr-x 1   99 users     42 Dec 18 14:02 vm

 

Permissions on Unraid server:

root@unraid:/mnt/user# ls -la pbs
total 4
drwxrwxrwx 1 nobody users     60 Dec 18 13:53 ./
drwxrwxrwx 1 nobody users      6 Dec 18 17:26 ../
drwxr-x--- 1 nobody users 524288 Dec  8 12:33 .chunks/
-rw-r--r-- 1 nobody users    297 Dec 18 00:01 .gc-status
-rw-r--r-- 1 nobody users      0 Dec  8 12:25 .lock
drwxr-xr-x 1 nobody users     48 Dec 18 14:00 ct/
drwxr-xr-x 1 nobody users     54 Dec 18 14:00 host/
drwxr-xr-x 1 nobody users     42 Dec 18 14:02 vm/

 

The bad news is that this same configuration won't work for an new NFS share. I tried to create a new one using the options listed above, and I couldn't recreate my initial success. I just hope the existing datastore keeps working...

 

 

 

 

Edited by rinseaid
Update on NFSv4
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.