Can't login after adding NFS shares

When I add some NFS network shares to my fstab and boot I get an error in the tty (before X.org starts)

“System is booting up. [another sentence I can’t remember rn].”
see pam_nologin

Authentification failure

and the tty isn’t usable anymore (can’t enter anything). I’m able to logon in another tty and edit the fstab. no X.org though

The fstab entry of my shares look like this:

192.168.178.99:/Backup /home/st/Backup nfs nofail,x-systemd.device-timeout=1ms,rw,defaults,retrans=5,_netdev 0 0

just with different sharenames and destination folders. they have identical options

When I remove/comment the entries and boot, the system starts normally. When I then add/uncomment them and reload the fstab using mount -a the shares work as expected. only when they’re in the fstab and the system boots I get this error. I suspect that the system tries to mount the shares too early

how to solve this?

I use arch btw

I’d leave just one NFS mount enable in your fstab, with just the minimum options needed to bring it up (like _netdev) and test if you can get it to boot-up without the error.

I also had issues with NFS mounts specified directly in fstab. Now, I use Autofs for mounting my NFS share at boot.

Here’s my configuration:

➜ ~ cat /lib/systemd/system/autofs.service

[Unit]
Description=Automounts filesystems on demand
After=network.target ypbind.service sssd.service network-online.target remote-fs.target
Wants=network-online.target nfs-client.target
Documentation=man:autofs(8)

[Service]
Type=forking
PIDFile=/run/autofs.pid
EnvironmentFile=-/etc/default/autofs
ExecStart=/usr/sbin/automount $OPTIONS --pid-file /var/run/autofs.pid
ExecReload=/bin/kill -HUP $MAINPID
TimeoutSec=180

[Install]
WantedBy=multi-user.target

➜ ~ cat /etc/auto.master

# [truncated comments]
+auto.master
/mnt/earth	/etc/auto.nfs

➜ ~ cat /etc/auto.nfs

h	-fstype=nfs4	192.168.0.2:/mnt/storage

This is under Linux Mint 20.2, but I don’t anticipate any major differences in Arch.

1 Like

Alright, thank you very much!

I looked up autofs in the Arch Wiki, set up a configuration that fits my needs and works. In Arch the directories are a bit different (/etc/autofs/auto.master).

I configured autofs to mount the root-directory of my OpenMediaVault NFS shares into a folder and created symlinks/bookmarks to them where I need it.
The only drawback is the freezing of certain file explorers like nautilus when the server isn’t available. I havn’t yet figured out the neccessary mount options to cut it down to a few seconds. But that’s a minor inconvinience since my NAS is 24/7 on anyways and shouldn’t happen in the first place

1 Like