How to add permission for motioneye to save videos on nfs shared folder

no_root_squash on Synology is set. Checked the owner of /mnt/nfs_client being root:root. Tried to change it to motion:root - like it is set for the default storage at /mnt/dietpi_userdata/motioneye. This did not work and returned "invalid argument.
Reason: I did setup the mount with DiePi-Drive_Manager, which fixed it to the user root:root. And does not allow any changes.
There might be an issue with the Drive_Manager.

I don’t think so. Just did a test with my Synology without issues. Mounted a NFS share and was able to change owner as well as permissions.

root@DietPiOPi5:~# df -h | grep nfs  2.7T  1.1T  1.6T  40% /mnt/nfs_client

Starting with owner root and 777 permissions

root@DietPiOPi5:~# ls -ls /mnt/ | grep nfs
0 drwxrwxrwx 1 root   root     54 May 11 22:20 nfs_client

Changing to user dietpi and 755 permissions

root@DietPiOPi5:~# chmod 755 /mnt/nfs_client/
root@DietPiOPi5:~# chown dietpi:dietpi /mnt/nfs_client/

Worked without issues, All has been set correctly.

root@DietPiOPi5:~# ls -ls /mnt/ | grep nfs
0 drwxr-xr-x 1 dietpi dietpi   54 May 11 22:20 nfs_client

Can you share the command you used to change owner/permissions.

Thx for the detailed input. I tried to change the ownership with:
sudo chown motion:root /mnt/nfs_client
Probably a bit rudimentary :wink:
The ownership showed that root had access to the Synology:
Will now follow your advise and send feedback.

Apparently the changeowner won’t work:

The Geman says: chown: the owner of ‘/mnt/nfs_client/’ will be changed: The arguement is invalid.
Probably the cause is the shortage of my knowledge on chown and chmod.

can you check settings inside your Synology again? This is how it looks for my prod system

Abolutely identical. We even use the same language :wink:

can you connect to your Synology on command line level and check how permissions looks like there?

Have made a new clean install on an SD, just root, no other user. Same result: motioneye or motion can’t write to the mnt-folder. And it is also not possible to change the owner to motion. BTW there is no user motioneye.
Going into Synology, there are within the shared folder “KameraSued” no sub-folders. Only my two test-files, which both have the owner “root”.
When you setup the mount-point, did you use the dietpi-drive_manager or did you go manually?

Thx for your patience.

Drive Manager should not have any influence. It is not doing anything else than mounting the NFS share. Theoretically you could do it manually if you like.

I would need to test it again.

I had the same issue with motion trying to access a synology share (samba in my case).
For me the solution described here did the trick, except that the umount-mount sequence did not work. I had to reboot instead.
And of course I used “uid=motion,gid=root,file_mode=0770,dir_mode=0770” in the fstab entry. Changed it with notepad++, not sed, but that shouldn’t matter.

Well, you are using SAMBA to mount your share while @EkkeNekkepenn has an NFS share. These are 2 different technologies and therefore the solution you linked is not applicable.

OK, I had naively supposed that it would work the same way under nfs.

I now tried the nfs-way and it worked after chown’ing the synology target directory to myusername:users and setting squash to ‘Alle Benutzer zu Admin zuordnen’
The owner:group of the mnt directory was 1027:users, probably because I had not used drive_manager but manually edited fstab by adding this line: /mnt/nfs_client nfs nofail,noauto,x-systemd.automount

Hi, for what it is good? Feel that I owe you some feedback.
The reason, why motioneye did not store any files, stems from the default settings under MOVIES in motioneye. The default is “H264/OMX (.mp4) " and these codecs are missing in the system. Just changing this setting to H264(.mp4)” does the trick because the related codecs are installed.

Maybe you want to forward this detail so that the dev-guys either change the default or load the codecs.

ping @MichaIng

Yes this is a known issue with motionEye, not only as it is supported on Raspberry Pi only, but also since it requries either the RPi’s legacy graphics stack or fake KMS enabled. With the new default (on RPi OS) full KMS stack, OMX does not work either.

However, this is a topic for the motionEye repo, and I agree the default should be just changed to “H264(.mp4)”.

Little addition: motion nicely saves videos to /mnt/dietpi_userdata/motioneye/Camera1, because the folder is set to motion:motion as user:group. When changing this to /mnt/samba (setup with drive_manager) motion will not store anything, because the folder is owned by dietpi:dietpi. Any attempts in changing the ownership to motion or using chmod -R 777 /mnt/samba fail. Somehow drive_manager blocked the folder. Manually created files under root get saved and show on the NAS - which is proof that there are no problems on the side of the NAS or the link.
Any hint will get a big German DANKE!

Did you use the GID and UID flags to write to the samba share as a different user?

Samba don’t support Linux file system permissions at all. Therefore, we mount Samba shares with a fixed user dietpi:dietpi. This as well is the reasion why chmod -R 777 /mnt/samba is failing.

of course because user root is able to write into data directory of user dietpi

The Drive Manager does not lock or block anything. It is a tool to mount a drive and create configuration entries in /etc/fstab. Just take a look at this file and you should see the samba mount, user and group used to mount the share. You should also see the file system permissions settings. You can adjust the settings manually if necessary, or you can add the user motion to the user group dietpi. This would probably be the best option.

gern geschehen

PRIMA, that was the solution. With usermod -a -G dietpi motion added and with groups motion to
motion : motion video dietpi verified. After reboot everything worked.
Thanks again.

thx for sharing @EkkeNekkepenn

One small request. Pls try to stick to English. Even if I understood German, rest of community probably not :wink:

For now I translate your post