Lxw2015
Posts: 55
Joined: Fri Feb 12, 2016 4:05 am

nfs-server.service failed

Fri Jan 11, 2019 8:54 pm

I tried to setup my pi as a NFS server.
1. sudo apt-get install nfs-common nfs-kernel-server
2. edit /etc/exports
add /home/pi 192.168.1.0/24(rw,sync)
3. sudo /etc/init.d/nfs-kernel-server restart

then I get
root@raspberrypi:/home/pi# sudo /etc/init.d/nfs-kernel-server restart
[....] Restarting nfs-kernel-server (via systemctl): nfs-kernel-server.serviceJob for nfs-server.service failed because the control process exited with error code.
See "systemctl status nfs-server.service" and "journalctl -xe" for details.
failed!
root@raspberrypi:/home/pi#

I'm new to this. please help. how to solve the issue. what I'm missing?

thanks
Xian

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: nfs-server.service failed

Fri Jan 11, 2019 9:00 pm

Lxw2015 wrote:
Fri Jan 11, 2019 8:54 pm
See "systemctl status nfs-server.service" and "journalctl -xe" for details.
What's the output of the two commands it told you to run to get details ?
(you might need to run them with sudo, and potentially just after trying to start/re-start the nfs service)

Lxw2015
Posts: 55
Joined: Fri Feb 12, 2016 4:05 am

Re: nfs-server.service failed

Fri Jan 11, 2019 9:15 pm

root@raspberrypi:/home/pi# systemctl status nfs-server.service
? nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2019-01-11 20:48:51 GMT; 22min ago
Process: 2118 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)

Jan 11 20:48:51 raspberrypi systemd[1]: Starting NFS server and services...
Jan 11 20:48:51 raspberrypi exportfs[2118]: exportfs: Failed to stat /srv/nfs4/share: No such file or directory
Jan 11 20:48:51 raspberrypi systemd[1]: nfs-server.service: Control process exited, code=exited status=1
Jan 11 20:48:51 raspberrypi systemd[1]: Failed to start NFS server and services.
Jan 11 20:48:51 raspberrypi systemd[1]: nfs-server.service: Unit entered failed state.
Jan 11 20:48:51 raspberrypi systemd[1]: nfs-server.service: Failed with result 'exit-code'.

Lxw2015
Posts: 55
Joined: Fri Feb 12, 2016 4:05 am

Re: nfs-server.service failed

Fri Jan 11, 2019 9:17 pm

root@raspberrypi:/home/pi# journalctl -xe
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nfs-server.service has begun starting up.
Jan 11 20:48:51 raspberrypi exportfs[2118]: exportfs: Failed to stat /srv/nfs4/share: No such file or directory
Jan 11 20:48:51 raspberrypi systemd[1]: nfs-server.service: Control process exited, code=exited status=1
Jan 11 20:48:51 raspberrypi systemd[1]: Failed to start NFS server and services.
-- Subject: Unit nfs-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nfs-server.service has failed.
--
-- The result is failed.
Jan 11 20:48:51 raspberrypi systemd[1]: nfs-server.service: Unit entered failed state.
Jan 11 20:48:51 raspberrypi systemd[1]: nfs-server.service: Failed with result 'exit-code'.
Jan 11 20:48:51 raspberrypi systemd[1]: Stopping NFS Mount Daemon...
-- Subject: Unit nfs-mountd.service has begun shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nfs-mountd.service has begun shutting down.
Jan 11 20:48:51 raspberrypi systemd[1]: Stopping NFSv4 ID-name mapping service...
-- Subject: Unit nfs-idmapd.service has begun shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nfs-idmapd.service has begun shutting down.
Jan 11 20:48:51 raspberrypi rpc.mountd[2117]: Caught signal 15, un-registering and exiting.
Jan 11 20:48:51 raspberrypi systemd[1]: Stopped NFSv4 ID-name mapping service.
-- Subject: Unit nfs-idmapd.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nfs-idmapd.service has finished shutting down.
Jan 11 20:48:51 raspberrypi systemd[1]: Stopped NFS Mount Daemon.
-- Subject: Unit nfs-mountd.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit nfs-mountd.service has finished shutting down.
Jan 11 20:48:51 raspberrypi sudo[2092]: pam_unix(sudo:session): session closed for user root

Lxw2015
Posts: 55
Joined: Fri Feb 12, 2016 4:05 am

Re: nfs-server.service failed

Fri Jan 11, 2019 9:23 pm

My bad I found a problem
Failed to stat /srv/nfs4/share: No such file or directory

Lxw2015
Posts: 55
Joined: Fri Feb 12, 2016 4:05 am

Re: nfs-server.service failed

Fri Jan 11, 2019 9:33 pm

followed instruction
https://www.instructables.com/id/Turn-R ... tem-versi/

then I could mount pi folder to my linux PC.

thanks
Xian

Return to “General discussion”