Debian 10 机器不会从 /etc/fstab 挂载 NFS 共享,但执行mount -a
挂载表示共享。我注意到启动时间更长。
# systemctl status home-user-weather-images.mount
● home-user-weather-images.mount - /home/user/weather/images
Loaded: loaded (/etc/fstab; enabled-runtime; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2020-10-23 05:36:34 EDT; 1min 1s ago
Where: /home/user/weather/images
What: 192.168.1.115:/volume1/user/Pictures/NOAA-images/
Docs: man:fstab(5)
man:systemd-fstab-generator(8)
Oct 23 05:36:34 host systemd[1]: Mounting /home/user/weather/images...
Oct 23 05:36:34 host mount[529]: mount.nfs: Network is unreachable
Oct 23 05:36:34 host systemd[1]: home-user-weather-images.mount: Mount
process exited, code=exited, status=32/n/a
Oct 23 05:36:34 host systemd[1]: home-user-weather-images.mount: Failed with result
'exit-code'.
Oct 23 05:36:34 host systemd[1]: Failed to mount /home/user/weather/images.
这是我尝试过的 fstab 条目:
192.168.1.115:/volume1/user/Pictures/NOAA-images/ /home/user/weather/images nfs
ac,user,nfsvers=3,x-systemd.requires=network-online.target,x-systemd.device-timeout=100
0 0
192.168.1.115:/volume1/user/Pictures/NOAA-images/ /home/user/weather/images nfs ac,user,nfsvers=3,_netdev 0 0
也试过了,没有成功:
systemctl reenable home-user-weather-images.mount
systemctl daemon-reload
以下是使用 x-systemd 选项时 fstab 条目的服务的样子:
# Automatically generated by systemd-fstab-generator
[Unit]
SourcePath=/etc/fstab
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
Before=remote-fs.target
After=network-online.target
Requires=network-online.target
[Mount]
Where=/home/user/weather/images
What=192.168.1.115:/volume1/user/Pictures/NOAA-images/
Type=nfs
Options=ac,user,nfsvers=3,x-systemd.requires=network-online.target
# dmesg | grep fstab
[ 5.157559] systemd-fstab-generator[260]: x-systemd.device-timeout ignored for 192.168.1.115:/volume1/user/Pictures/NOAA-images/
[ 114.512926] systemd-fstab-generator[1025]: x-systemd.device-timeout ignored for 192.168.1.115:/volume1/user/Pictures/NOAA-images/
[ 470.095851] systemd-fstab-generator[1162]: x-systemd.device-timeout ignored for 192.168.1.115:/volume1/user/Pictures/NOAA-images/
# dmesg | grep nfs
[no output]