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

I have motioneye running on a RaspberryPi running dietpi and the video files are to be stored in another dietpi with a lot more storage.

I mount the remote location on RaspberryPi box as root with the following command

mount -t nfs <internal_ip>:/mnt/dietpi_userdata/shared_254/ /mnt/dietpi_userdata/shared_254/

I agree there is no mention of any user for motioneye.

This mount works fine with transmission, but I don’t seem to be able to save video files on the shared folder.

Any thoughts?

did you already set no_root_squash option on NFS server side? And the folder Motioneye should write on, has sufficiant permission?

Just a guess with the default DietPi NFS share:

usermod -aG dietpi motioneye

I am in the same squeeze - installed all fine - worked well.
Then used DietPi-Drive_Manager to link to my Synology-NAS.
Speed test went ok.
Placed simple txt-file into mount and it showed on the NAS.
Changed the storage folder to /mnt/nfs_client.
Nothing is showing up on the NAS.

"usermod -aG dietpi motioneye" failed, because user motioneye is unknown.

Any idea?

Did you already tried to set no_root_squash option on your Synology?

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)”.