在尝试挂载远程 CIFS 共享之前,如何等待物理网络接口和网络协议栈启动?

在尝试挂载远程 CIFS 共享之前,如何等待物理网络接口和网络协议栈启动?

我在启动时安装远程共享时遇到问题。在网络接口准备好之前尝试安装 - 我已经_netdev在以下位置找到了所需的行/etc/fstab

//192.168.0.160/raspi /zeus/raspi cifs rw,auto,uid=1001,gid=1002,file_mode=0755,dir_mode=0755,_netdev,vers=3,credentials=/etc/.smbcredentials_raspi_01 0 0

dmesg这是比我更好地解释这个问题的部分:

[   46.789814] FS-Cache: Loaded
[   47.278702] FS-Cache: Netfs 'cifs' registered for caching
[   47.534038] Key type cifs.spnego registered
[   47.534076] Key type cifs.idmap registered
[   47.536636] CIFS: Attempting to mount //192.168.0.160/raspi
[   47.536991] CIFS: VFS: Error connecting to socket. Aborting operation.
[   47.537019] CIFS: VFS: cifs_mount failed w/return code = -101
[   47.628859] sun7i-dwmac 1c50000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   47.628926] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   51.299626] PPP generic driver version 2.4.2
[   51.346063] NET: Registered protocol family 24
[   51.695526] l2tp_core: L2TP core driver, V2.0
[   51.797914] l2tp_netlink: L2TP netlink interface
[   51.838658] l2tp_ppp: PPPoL2TP kernel driver, V2.0
[   78.924908] device eth0 entered promiscuous mode
[  124.605250] perf: interrupt took too long (2531 > 2500), lowering kernel.perf_event_max_sample_rate to 79000
[  157.116937] perf: interrupt took too long (3183 > 3163), lowering kernel.perf_event_max_sample_rate to 62750
[  204.593797] perf: interrupt took too long (4016 > 3978), lowering kernel.perf_event_max_sample_rate to 49750
[  276.966459] perf: interrupt took too long (5041 > 5020), lowering kernel.perf_event_max_sample_rate to 39500
[  395.988260] perf: interrupt took too long (6303 > 6301), lowering kernel.perf_event_max_sample_rate to 31500
[  863.282125] CIFS: Attempting to mount //192.168.0.160/raspi

在863.282125我手动发出命令mount /zeus/raspi,成功创建了远程fs挂载。

我一个多月以来一直在努力解决这个问题。任何人都可以帮助我让操作系统等待网络物理链路和 IP 协议栈完全启动,然后再尝试使用 in 线路连接到远程共享/etc/fstab吗?

root@loki:~# uname -a
Linux loki 5.10.60-sunxi #21.08.2 SMP Tue Sep 14 16:28:44 UTC 2021 armv7l armv7l armv7l GNU/Linux
root@loki:~# systemd --version
systemd 245 (245.4-4ubuntu3.13)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

Armbian 21.08.6 Focal 与 Linux 5.10.60-sunxi

https://github.com/search?q=armbian

https://www.armbian.com/banana-pi-pro/

答案1

看起来像一个错误。

选项_netdev(您已经拥有)是您需要的 - 它告诉挂载这是网络设备,应在网络接口启动后挂载。

我会从查看操作系统本身和安装模块开始——也许它们太旧了,不知道_netdev选项并可以更新吗?

相关内容