By B M Shukla
I strictly followed the instructions but while executing mount command got the following.
root@cgs1:~# mount -vvvv cgs2:/2d1 /mnt
mount.nfs: timeout set for Thu Aug 20 23:12:54 2020
mount.nfs: trying text-based options 'vers=4.2,addr=172.31.101.9,clientaddr=172.20.160.50'
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting cgs2:/2d1
I have checked my /etc/exports, ufw status etc but failed to solve it.
My point is please add troubleshooting in this article.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The error you are receiving means that the NFS server doesn’t have the correct permissions to allow this client to connect.
You would need to include your config file and show what host access you have setup on the server side to ensure that you have the correct IP address and directories setup for exporting.
You can Ensure that the NFS server (cgs2 in your case) is up and running. You can check its status using:
systemctl status nfs-server
Confirm that the directory /2d1 on cgs2 is correctly exported. Check the /etc/exports file:
cat /etc/exports
Ensure the export options are correctly set. Reload the NFS server if changes were made:
exportfs -ra
Confirm that the firewall on the NFS server allows connections. NFS typically uses port 2049. Check the firewall status:
ufw status
If ufw is active, make sure it allows NFS traffic:
ufw allow from <client_IP> to any port nfs
The mount command specifies NFS version 4.2. Ensure that the NFS server supports this version. If not, you may need to adjust the mount options or the server’s NFS configuration.
Ensure that the client machine supports the NFS version specified in the mount command. You can check the supported versions:
rpcinfo -p | grep nfs
Confirm that the directory /mnt on the client machine has appropriate permissions. It should be writable by the user attempting the mount.
You can also check our articles on NFS mount points here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-22-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-22-04
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.