Mount.nfs: failed to prepare mount: Operation not permitted

Hello Everyone. Novice user here with a problem. I have just purchased another Synology NAS and am trying to mount it on my system. This is my fstab entry which worked fine for my previous unit (names of share and IP address changed of course).

//192.168.1.122/Music/ /home/martin/Shares/Music/ nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0

but this time, although the name of the share appears in Thunar, when I try to connect I get the ‘failed to prepare mount’ error. I have spent some time confusing myself searching for possible solutions without any luck. Has anyone any clues as to where I should be looking for a solution?

Many thanks,
Martin

Maybe try this for testing:

sudo mount --verbose --mkdir --types nfs --options timeo=14,hard,intr 192.168.1.122:/Music/ /tmp/Music

Hint:
SAMBA: → //192.168.1.122/Music/
NFS → 192.168.1.122:/Music/

1 Like

Without " // " and with a colon " : " after the IP. It should be:
192.168.1.122:/Music /home/martin/Shares/Music nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0

I would also use the “nofail” and “_netdev” mount options. This is my line:

192.168.100.25:/media /mnt/nas/media nfs noauto,nofail,x-systemd.automount,_netdev 0 0

After the change:

sudo systemctl daemon-reload &&
sudo systemctl restart remote-fs.target
1 Like

Hello megavolt and thank you very much for the reply.

No luck I’m afraid. Here’s the output:

sudo mount --verbose --mkdir --types nfs --options timeo=14,hard,intr 192.168.1.122:/Music/ /tmp/Music
mount.nfs: timeout set for Wed Aug 23 20:40:32 2023
mount.nfs: trying text-based options 'timeo=14,hard,intr,vers=4.2,addr=192.168.1.122,clientaddr=192.168.1.227'
mount.nfs: mount(2): Permission denied
mount.nfs: trying text-based options 'timeo=14,hard,intr,vers=4,minorversion=1,addr=192.168.1.122,clientaddr=192.168.1.227'
mount.nfs: mount(2): Permission denied
mount.nfs: trying text-based options 'timeo=14,hard,intr,vers=4,addr=192.168.1.122,clientaddr=192.168.1.227'
mount.nfs: mount(2): Permission denied
mount.nfs: trying text-based options 'timeo=14,hard,intr,addr=192.168.1.122'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.122 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.1.122 prog 100005 vers 3 prot UDP port 892
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting 192.168.1.122:/Music/

So is this a permissions thing in the Synology? I’ve check and rechecked and can’t see anything obvious. I am the admin and have full read/write access to the share. What else is there to check?

Many thanks again for taking the time to reply.

Martin

Hello Wibol and thanks very much for your reply. As you can see no luck so far. I pasted your revised text into fstab and restarted the systemd commands you recommended but we’re no further forward I’m afraid.

Thanks again for your reply.
Martin

Did you add the local IP of your computer or IP range of your local network to the whitelist? Otherwise any connection will be denied. As you should know, NFS has no credentials, but a black or white list. To allow and block certain IP addresses.

Keep sure that your computer has always the same local IP, which is allowed on your Synology.

As megavolt says, make sure that the server file /etc/exports is set to “192.168.XXX.0/24” or similar to allow access to all computers on your network. These are my lines:

/srv/nas 192.168.XXX.0/24(rw,sync,no_subtree_check,fsid=0)
/srv/nas/media 192.168.XXX.0/24(rw,sync,no_subtree_check,nohide,insecure)

Anyway, are you sure you need to do a local mount? Using SFTP from your file explorer can do almost anything. Just paste in its address bar and then add to Bookmarks:

sftp://REMOTE-USER@REMOTE-IP/PATH/TO/Music

More information about Easy access to remote folders

Hello Wibol & megavolt - your continued patience is extremely welcome.

Firstly perhaps I should explain what I’m doing. I have a 6TB HD in the pc that stores my music collection. I copy that to the NAS which serves a SONOS system and Jellyfin provides the access. Every now and then I upload any new recordings to the NAS with grsync and hey presto! This has worked very well for the past few years until my new NAS!

I have tried sftp://martin@192.168.1.122/Music (and permutations of) with no luck - the error says ‘Connection refused by server’. I have checked the firewall rules on the NAS (which is clear). My file /etc/exports is all commented out so there is nothing in that at all (I will try your additions later tonight). I can connect to the NAS via Firefox but its the copying access I’m after.

Regards,
Martin

From what I see on the Synology Website: https://kb.synology.com/en-br/DSM/tutorial/How_to_access_files_on_Synology_NAS_within_the_local_network_NFS

It has to something like:

192.168.1.122:/volume-x/Music

Because / is the root of the filesystem (like on any linux), /volume-x is the mountpoint of the HDD, where you should have created the folder Music.

I also have a synology NAS and mount via NFS but I don’t do that via fstab anymore since I started using autofs - I recommend this as a better alternative as it works by defining mount points on your machine that will mount when you try to access them if the server is on (or not if it’s off). If you stick with fstab mounting hopefully the Synology stuff here will help. I was hoping I had an old fstab backed up from before or some commented out mounts, but they were on my old machine.

I have my internal network subnet whitelisted for NFS access in the Synology Control Panel > Shared Folder > {my-folder} > NFS Permissions like this (for each folder available)…
IP Range Start/Subnet Mask | Read/Write | Map all users to admin | Yes | Denied | Allowed

Under Control Panel > File Services > SMB/AFP/NFS I have “Enable NFS” checked.

If you want to try autofs instead…
On my PC, with autofs installed, I have a folder /etc/autofs/ - In there I have edited the provied autofs.master file to point to my shares so the last 2 lines in the file are…

/mnt /etc/autofs/auto.shares --time-out=10 --ghost
+auto.master

This tells autofs that the directories in the folder /mnt are mounted by mount points defined in auto.shares.

auto.shares looks like this…

backups -fstype=nfs,rw,soft,retry=0 mediastation.local:/volume1/backups
homes -fstype=nfs,rw,soft,retry=0 mediastation.local:/volume1/homes
music -fstype=nfs,rw,soft,retry=0 mediastation.local:/volume1/music
video -fstype=nfs,rw,soft,retry=0 mediastation.local:/volume1/video
public -fstype=nfs,rw,soft,retry=0 mediastation.local:/volume1/public

The first elemen on each line is the name of the directory so, for example, /mnt/backups/ will mount to the backups share on the NAS whenever anything tries to access the folder on my machine. This is all kinds of seamless neat.

NOTE: mediastation.local is in my hosts file and points to the IP of my NAS.

Hello Wibol, this sounded promising so I gave it a try:

sftp://martin@192.168.1.122/volume1/Music

but unfortunately it didn’t work - Failed to open Music Connection failed.

Onwards and upwards!

Thanks again.

Martin

Hello megavolt, thanks again.

I’ve tried this with the fstab entry:
192.168.1.122:/volume1/Music /home/martin/Shares/Music nfs noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,hard,intr,noatime 0 0

and I’m back to the Operation not permitted error message.

Regards,

Martin

It is possible that the SSH service of the server is not active or uses another port other than 22, in which case it would be:

sftp://REMOTE-USER@REMOTE-IP:PORT/PATH/TO/Music

Remember to paste the line into the address bar of the file explorer for add to Bookmarks.

Hello Wibol, I’m afraid I get ‘Connection refused by server’ error. Still no luck.

I’m going back to the setup I used when I initiated the NAS just to make sure there are no basic errors and cant find anything. I’ve been through three Synology set up guides on YouTube to check what I’ve done and can’t see any problems. I’ve returned to ‘basics’ and retried SMB and I get a

error 13 (Permission denied) opening credential file /home/martin/.cif_creds

I’ve checked the permissions on the creds file and its set at 600.

I’m going round in circles here and don’t seem to getting anywhere! :frowning:

Thanks again,

Martin

Hello Everyone and thanks to everyone who read and helped.

I have a solution!

I went via the Synology helpdesk and they sent me several suggestions which didn’t work but eventually they hit one that did.

In the Synology go to Control Panel>Shared Folder>nfs permissions>edit

The IP address required is the internal IP address of my computer. What threw me off is that the permissions were already set when I set up the NAS so I presumed this would be what was required by the machine. Not so!

So I checked with ip address and got the correct one and hey presto!

I hope this helps someone.

Regards,

Martin

Well I assumed you checked it, since it was almost the first advice:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.