AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / computer / 问题 / 1596715
Accepted
user515655
user515655
Asked: 2020-10-24 02:14:25 +0800 CST2020-10-24 02:14:25 +0800 CST 2020-10-24 02:14:25 +0800 CST

无法在启动时挂载 nfs,但手动工作“网络无法访问”w/systemd

  • 772

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]
linux boot
  • 2 2 个回答
  • 3395 Views

2 个回答

  • Voted
  1. Best Answer
    Reda Salih
    2020-10-24T03:25:26+08:002020-10-24T03:25:26+08:00

    我会建议两个行动:

    1-将以下内容添加到安装选项以延迟安装一段时间:

    [Mount]
        Options=late,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=10 0 0
    

    2- 在安装部分中添加上述内容,以便在到达remote-fs目标 之前安装 nfs 挂载。

    [Install] WantedBy=remote-fs.target
    

    有时可能是由于 DNS 解析,但我在这里没有看到。

    编辑:由于您有一个嵌入式 eno0 接口,因此您必须在 DHCP 配置中声明它的正确名称,原因是您找不到 eth0 设备,有时启用/禁用 NetworkManager 会导致 NIC 命名混淆。

    • 0
  2. user515655
    2020-10-25T01:09:06+08:002020-10-25T01:09:06+08:00

    /etc/network/interfaces.d/setup需要编辑该文件以反映从 eth0 到 eno1 的正确设备。

    network.service 也失败了(但网络设法以某种方式工作)。我的 /etc/default/networking 和 /etc/dhcp/* 文件未修改。这是来自的输出journalctl -u networking.service:

    -- Logs begin at Fri 2020-10-23 06:57:31 EDT, end at Fri 2020-10-23 07:00:15 EDT. --
    Oct 23 06:57:32 host systemd[1]: Starting Raise network interfaces...
    Oct 23 06:57:32 host ifup[425]: Internet Systems Consortium DHCP Client 4.4.1
    Oct 23 06:57:32 host ifup[425]: Copyright 2004-2018 Internet Systems Consortium.
    Oct 23 06:57:32 host ifup[425]: All rights reserved.
    Oct 23 06:57:32 host ifup[425]: For info, please visit https://www.isc.org/software/dhcp/
    Oct 23 06:57:32 host dhclient[492]: Internet Systems Consortium DHCP Client 4.4.1
    Oct 23 06:57:32 host dhclient[492]: Copyright 2004-2018 Internet Systems Consortium.
    Oct 23 06:57:32 host dhclient[492]: All rights reserved.
    Oct 23 06:57:32 host dhclient[492]: For info, please visit https://www.isc.org/software/dhcp/
    Oct 23 06:57:32 host dhclient[492]: 
    Oct 23 06:57:32 host ifup[425]: Cannot find device "eth0"
    Oct 23 06:57:32 host dhclient[492]: Failed to get interface index: No such device
    Oct 23 06:57:32 host ifup[425]: Failed to get interface index: No such device
    Oct 23 06:57:32 host ifup[425]: If you think you have received this message due to a bug rather
    Oct 23 06:57:32 host ifup[425]: than a configuration issue please read the section on submitting
    Oct 23 06:57:32 host ifup[425]: bugs on either our web page at www.isc.org or in the README file
    Oct 23 06:57:32 host ifup[425]: before submitting a bug.  These pages explain the proper
    Oct 23 06:57:32 host ifup[425]: process and the information we find helpful for debugging.
    Oct 23 06:57:32 host ifup[425]: exiting.
    Oct 23 06:57:32 host dhclient[492]: 
    Oct 23 06:57:32 host dhclient[492]: If you think you have received this message due to a bug rather
    Oct 23 06:57:32 host dhclient[492]: than a configuration issue please read the section on submitting
    Oct 23 06:57:32 host dhclient[492]: bugs on either our web page at www.isc.org or in the README file
    Oct 23 06:57:32 host dhclient[492]: before submitting a bug.  These pages explain the proper
    Oct 23 06:57:32 host dhclient[492]: process and the information we find helpful for debugging.
    Oct 23 06:57:32 host dhclient[492]: 
    Oct 23 06:57:32 host dhclient[492]: exiting.
    

    但是我的以太网设备是 eno1:

    $ ip link
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
        link/ether 54:b2:03:8d:53:f6 brd ff:ff:ff:ff:ff:ff
    

    再次检查 dmesg...

    # dmesg | grep -i eth
    [    3.170430] e1000e 0000:00:1f.6 eth0: (PCI Express:2.5GT/s:Width x1) 54:b2:03:8d:53:f6
    [    3.170431] e1000e 0000:00:1f.6 eth0: Intel(R) PRO/1000 Network Connection
    [    3.170489] e1000e 0000:00:1f.6 eth0: MAC: 12, PHY: 12, PBA No: FFFFFF-0FF
    [    3.171438] e1000e 0000:00:1f.6 eno1: renamed from eth0
    

    回到谷歌,查找了为什么 ifup 找不到重命名的接口。遇到了这个答案。检查我的/etc/network/interfaces.d/setup:

    auto lo
    iface lo inet loopback
    
    auto eth0
    iface eth0 inet dhcp
    

    ...看起来像吸烟枪。我从未编辑过这个文件;这是一周前的安装,所以我不知道为什么会出现这个问题。对其进行了编辑,将 fstab 恢复为非 x-systemd 条目并重新启动。现在它起作用了。

    在我考虑回答我自己的问题之前,如果有人能首先解释为什么会发生这种混乱,那将是“最好的答案”,这将是一件很有趣的事情。

    • 0

相关问题

  • 如何让我的 Linux 机器看起来像是在运行 Windows?

  • 对于 cp 或 mv,是否有等同于 cd - 的东西?

  • 以 root 身份运行 docker 容器

  • 如何在域和 Linux 活动目录中启用指纹传感器

  • 如何在CentOS 7 中将Ctrl+C 永久更改为Ctrl+K?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    v15 为什么通过电缆(同轴电缆)的千兆位/秒 Internet 连接不能像光纤一样提供对称速度? 2020-01-25 08:53:31 +0800 CST
  • Martin Hope
    fixer1234 “HTTPS Everywhere”仍然相关吗? 2019-10-27 18:06:25 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve