Thursday, February 16, 2023

NFS won't start, down the rabbit hole we are going




NFS stopped working? 

systemctl start nfs-server.service - hangs and tells you to check journalctl -xe ??

journalctl -xe saying something about a missing drive, even though the drive was never exported?

-- Subject: Unit nfs-server.service has failed

-- Defined-By: systemd

Feb 14 20:31:16 amber systemd[1]: nfs-server.service: Job nfs-server.service/st>

Feb 14 20:31:16 amber systemd[1]: seagate8.mount: Job seagate8.mount/start fail>

Feb 14 20:31:16 amber systemd[1]: dev-disk-by\x2dlabel-seagate8.device: Job dev>

Feb 14 20:31:16 amber systemd[1]: dev-disk-by\x2dlabel-seagate7.device: Job dev>

Feb 14 20:31:16 amber systemd[1]: Timed out waiting for device Expansion_Desk s>

-- Subject: Unit dev-disk-by\x2dlabel-seagate7.device has failed

WAIT! No need to reboot! Hey, this isn't Windows, we can fix it!

And the solution (likely) is: 

systemctl daemon-reexec

OR

systemctl daemon-reload

The the reason NFS won't run (in some cases) has nothing to do with NFS or /etc/exports - it's a problem with systemd. One could consider it a "feature" or a bug. Personally I think systemd is a bug, causes more trouble than it solves. I've seen and fixed this NFS won't start problem several times over the years and finally got around to writing down the solution, as from Google I see a ton of posts with these errors messages and no correct answers. Just a lot of jump through hoops, chase down rabbit holes and check your kernel module FUD.