Jobs for nfs-server.service canceled
Solution 1
In case this helps someone in the future:
I had the same error message setting up NFS on a Raspberry Pi running raspbian (a Debian Buster derivative), despite having felt I was following instructions precisely.
Running "sudo systemctl" by itself showed me a list of services, and showed that "nfs-server.service" had loaded but failed to run.
What solved it for me was to remove white space from the /etc/exports file lines: e.g.
/nfs/share 192.168.1.200/24(rw,nohide,insecure,no_subtree_check,async)
instead of the line I had originally typed:
/nfs/share 192.168.1.200/24(rw, nohide, insecure, no_subtree_check, async)
This occurred to me after reading about some else having the issue when they copy-pasted the lines rather than manually typed them.
No more error message and 'sudo systemctl' showed that the service is now up and running.
Hope this helps.
Solution 2
This may have different reasons for failure, it is better to check the log first, the default log of it should in /var/log/messages
. For easy debugging it, you could try to trace the log like tail -f /var/log/messages
, then start another terminal do like: sudo systemctl start nfs-server
. In my case, I can find the issue of
exportfs: Failed to stat /var/nfs/mynfs: No such file or directory
Then just fix it by creating this file.
Related videos on Youtube
Shrikant Navghare
Updated on September 18, 2022Comments
-
Shrikant Navghare almost 2 years
I am trying to setup an NFS server but after starting the service it is showing this error;
Job for nfs-server.service canceled.
This is my configuration file (
/etc/exports
)/fold1 192.168.43.226
Error message:
● nfs-server.service - NFS server and services Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled) Drop-In: /run/systemd/generator/nfs-server.service.d └─order-with-mounts.conf Active: failed (Result: exit-code) since Mon 2020-09-28 19:27:13 IST; 40s ago Process: 18660 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS) Process: 18656 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS) Process: 18654 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE) Sep 28 19:27:13 localhost.localdomain systemd[1]: Starting NFS server and services... Sep 28 19:27:13 localhost.localdomain exportfs[18654]: exportfs: Failed to stat /fold1: No such file or directory Sep 28 19:27:13 localhost.localdomain systemd[1]: nfs-server.service: Control process exited, code=exited status=1 Sep 28 19:27:13 localhost.localdomain systemd[1]: nfs-server.service: Failed with result 'exit-code'. Sep 28 19:27:13 localhost.localdomain systemd[1]: Stopped NFS server and services.
I am using Red Hat 8.
-
jsbillings almost 4 yearsIt might be good if you gave the full error output for the job, not just that it was cancelled.
-
Shrikant Navghare almost 4 years@jsbillings Done!
-
jsbillings almost 4 yearsDid you see the error message that read:
exportfs: Failed to stat /fold1: No such file or directory
? -
Shrikant Navghare almost 4 years@jsbillings yes I read that, but i have that folder in my home directory
-
-
Shrikant Navghare over 3 yearsIt worked when I added full path of the folder
-
Admin about 2 yearsI couldn't find the log messages (/var/log/messages) to resolve this. What to do next?