Hi.
I just installed Linux again after a long time of just Mac and Windows, and this time I'm trying to learn it properly.
So, I have an NFS share on my MX Linux laptop, exported from a Raspberry Pi, on my local network. If I do not unmount it before shutdown, the process takes an excruciatingly long time, and the logs often get stuck at "Shutting down ALSA... done" or "Stopping enhanced syslogd: rsyslogd."
Right now this is the fstab entry for the NFS share:
server:directory mountpoint nfs defaults 1 2
It's a basic fstab entry as you can see. I've tried it with defaults,noatime 0 0 or defaults,soft 0 0 and what have you.
It's no deal breaker in using MX Linux which I'm liking so far, but I would really appreciate a solution to this and an explanation.
NFS export causes shutdown to slow or hang
Re: NFS export causes shutdown to slow or hang
Are you booting with the systemd option? There's a known bug in systemd shutdown with nfs mounts open. If you're not using the systemd option we'll have to look elsewhere.
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Re: NFS export causes shutdown to slow or hang
I'm not using systemd. I always booted up with the initial option, though I tried using systemd as well and the only difference is that when I choose systemd the nfs directory isn't mounted... not sure what to do with that though. Maybe the fstab entry isn't being read. Anyway in both cases if I do not have directory unmounted before initiating shutdown it has the same results.
Re: NFS export causes shutdown to slow or hang
I'm afraid for a "real" solution you'd have to hunting through the syslog for error messages.
What generally causes this problem is that the network connection gets shut down before the shutdown sequence tries to umount the filesystems. umount can't connect to the nfs server because the network is down and eventually times out.
However as a workaround you can change the timeout wait from its default (60 seconds IIRC) to a much shorter one. The timeo= mount option sets that wait time in tenths of a second, so addto your mount parameters to change the timeout to 3 seconds.
What generally causes this problem is that the network connection gets shut down before the shutdown sequence tries to umount the filesystems. umount can't connect to the nfs server because the network is down and eventually times out.
However as a workaround you can change the timeout wait from its default (60 seconds IIRC) to a much shorter one. The timeo= mount option sets that wait time in tenths of a second, so add
Code: Select all
timeo=30
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Re: NFS export causes shutdown to slow or hang
I will try setting that option and get back. However may I ask, where I would see syslog error messages?
Re: NFS export causes shutdown to slow or hang
/var/log/syslog
Search for shutdown then read down. Each entry is timestamped so you can quickly see where the delay is happening.
If you don't find shutdown then the logfile has likely rolled over and the previous one will be in /var/log/syslog.1
Search for shutdown then read down. Each entry is timestamped so you can quickly see where the delay is happening.
If you don't find shutdown then the logfile has likely rolled over and the previous one will be in /var/log/syslog.1
HP Pavillion TP01, AMD Ryzen 3 5300G (quad core), Crucial 500GB SSD, Toshiba 6TB 7200rpm
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Dell Inspiron 15, AMD Ryzen 7 2700u (quad core). Sabrent 500GB nvme, Seagate 1TB
Re: NFS export causes shutdown to slow or hang
Hi. Just wanted to post an update.
This was a few days ago:
I had to clean my desk so I powered off my RPi containing the NFS export, and when it rebooted all of a sudden I couldn't get NFS to work, something with proc-fs-nfsd.mount. If I'm wrong well I can't remember it exactly. Anyway I got frustrated after a bit and needed to get my files working so I decided to wipe my SD card and reinstall Raspbian. For some reason this time it hasn't given me problems on shutdown. Of course I'd rather have solved it manually but oh well.
This was a few days ago:
I had to clean my desk so I powered off my RPi containing the NFS export, and when it rebooted all of a sudden I couldn't get NFS to work, something with proc-fs-nfsd.mount. If I'm wrong well I can't remember it exactly. Anyway I got frustrated after a bit and needed to get my files working so I decided to wipe my SD card and reinstall Raspbian. For some reason this time it hasn't given me problems on shutdown. Of course I'd rather have solved it manually but oh well.