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
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1405231
Accepted
719016
719016
Asked: 2022-04-29 02:08:20 +0800 CST2022-04-29 02:08:20 +0800 CST 2022-04-29 02:08:20 +0800 CST

无法在 Ubuntu 22.04 上挂载 nfs

  • 772

我已经在一台机器上安装了 Ubuntu 22.04,我正在尝试挂载一个 NFS 共享,它在其他 Linux Ubuntu 机器(21.04、20.04、18.04 等)的阵列上挂载没有问题。

我们使用的命令是:

sudo apt install nfs-common # Only required once for installation
sudo mount -t nfs 10.234.123.11:/bfx_share1 /bfx_share1

如果我这样做:

sudo showmount -e 10.234.123.11

它显示了可能的坐骑列表,因此在这方面一切都是犹太教。

它只是卡在那里,什么也没做。有任何想法吗?我可以做些什么或添加什么来调试情况?没有其他客户nfs-common吗?

我已经安装nfstrace并在尝试挂载 nfs 文件夹时,我在另一个终端中启动了它,以获得以下提示:

## On one terminal
(base) user@LS6-MS-7D04:~$ ping 10.234.123.11
PING 10.234.123.11 (10.234.123.11) 56(84) bytes of data.
64 bytes from 10.234.123.11: icmp_seq=1 ttl=64 time=0.202 ms
64 bytes from 10.234.123.11: icmp_seq=2 ttl=64 time=0.122 ms
64 bytes from 10.234.123.11: icmp_seq=3 ttl=64 time=0.172 ms
^C
--- 10.234.123.11 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2027ms
rtt min/avg/max/mdev = 0.122/0.165/0.202/0.033 ms
(base) user@LS6-MS-7D04:~$ sudo mount 10.234.123.11:/bfx_share1 /bfx_share1


## In the other terminal with nfstrace running

root@LS6-MS-7D04:/home/user# nfstrace -Z user
Log file: nfstrace.log
Read from interface: enp111s0
  BPF filter  : port 2049 or port 445
  snapshot len: 65535 bytes
  read timeout: 100 ms
  buffer size : 20971520 bytes
  promiscuous mode: on
  capture traffic : inout
Processing packets. Press CTRL-C to quit and view results.
Detect session 10.234.123.8:902 --> 10.234.123.11:2049 [TCP]
Detect session 10.234.123.8:772 --> 10.234.123.11:2049 [TCP]
10.234.123.8:772 --> 10.234.123.11:2049 [TCP]NULL
        CALL  []
        REPLY []
Detect session 10.234.123.8:947 --> 10.234.123.11:2049 [TCP]
10.234.123.8:947 --> 10.234.123.11:2049 [TCP]NULL
        CALL  []
        REPLY []

查看 Ubuntu 22.04 的发行说明(Jammy Jellyfish 发行说明): https ://discourse.ubuntu.com/t/jammy-jellyfish-release-notes/24668?_ga=2.137381111.630065420.1651222708-2033241278.1650531954

有一段:

UDP disabled for NFS mounts
Since Ubuntu 20.10 (“Groovy Gorilla”), the kernel option CONFIG_NFS_DISABLE_UDP_SUPPORT=y is set and this disables using UDP as the transport for NFS mounts, regardless of NFS version.

In practice, if you try to use udp, you will get this error:

$ sudo mount f1:/storage /mnt -o udp
mount.nfs: an incorrect mount option was specified

###

NFS server
The NFS server and client packages have finally been updated to the latest upstream version.

All NFS services now read their configuration from /etc/nfs.conf and /etc/nfs.conf.d/*.conf, which is an INI-style configuration file, where each section is about one daemon or aspect of the NFS service. The old /etc/defaults/nfs-* configuration files are still left around, but are unused.

During upgrade, a conversion script is run if the package detects that the /etc/default/nfs-* files have been changed. This script is /usr/share/nfs-common/nfsconvert.py and it will read the options from /etc/defaults/nfs-* and generate /etc/nfs.conf.d/local.conf, which overrides the defaults in /etc/nfs.conf.

If the conversion script fails for some reason, the package installation or upgrade will fail, and the issue will have to be resolved. Please file a bug against nfs-utils in Launchpad 2 if you encounter such a scenario.

A new tool called nfsconf(8) can be used to query the configuration settings of /etc/nfs.conf and /etc/nfs.conf.d/*.conf.

##

the CTDB package was adjusted to work with the new NFS server version shipped in this Ubuntu 22.04

我已经提交了一份错误报告: https ://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/1970898

nfs
  • 5 5 个回答
  • 4633 Views

5 个回答

  • Voted
  1. Best Answer
    Daniele Piccioni
    2022-05-01T06:37:00+08:002022-05-01T06:37:00+08:00

    虽然我不完全确定原因,但我发现添加mountvers=3到挂载选项可以解决挂起问题。

    所以

    mount -t nfs -o mountvers=3 <server_ip>:/path/to/shared-folder /path/to/local/mount
    

    导致正确的安装。

    我的解释是,如果 NFS 服务器的多个版本(例如 3 和 4)在同一台服务器上运行,这mountvers将有助于使用正确的版本。

    • 2
  2. JohnShep
    2022-05-01T06:47:37+08:002022-05-01T06:47:37+08:00

    有同样的问题,使用这个解决方案让 fstab 工作......

    192.168.1.10:/foo     /home/john/foo nfs4   auto,vers=3 0 0
    
    • 2
  3. C.G.B. Spender
    2022-05-03T00:34:08+08:002022-05-03T00:34:08+08:00

    mountvers=4.0 也适用于我

    根据https://ubuntuforums.org/showthread.php?t=2474184 ,显然问题在于它默认为4.2

    • 1
  4. Quantanglement
    2022-05-09T13:20:14+08:002022-05-09T13:20:14+08:00

    对于初学者来说,Ubuntu 22.04 的 nfs-common 似乎将“nfsvers”选项更改为“mountvers”

    sudo mount -t nfs -o mountvers=4 [server IP]:/remote/path /local/mount/path
    

    注意:两者都mountvers=3适用mountvers=4于我的 QNAP NAS 服务器。

    • 0
  5. Izzo
    2022-05-11T13:17:08+08:002022-05-11T13:17:08+08:00

    我还可以确认其他人已经发布的内容。在 Ubuntu 22.04 上,该nfsvers选项需要替换为mountvers.

    但是在我从 20.04 LTS 迁移到 22.04 LTS 以及我的 QNAP v4.3.6.1965 之后,这仍然不起作用,之前它在 NFS4 上运行良好。

    我检查了多个 stackoverflow/askubuntu/等。线程和Ubuntu升级后没有任何工作。但这是对我真正有用的东西(还没有找出根本原因):

    1. 使用mountvers=4.0而不是nfsvers作为 in/etc/fstab或您的mount呼叫的选项
    2. 即使mountvers=4.0仅使用 NFS3 最终在挂载期间使用并且唯一真正起作用的东西。所以(不幸的是)确保在 QNAP 的 NFS 设置中也启用 NFS3。
    3. 如果您仍然收到mount.nfs: mount(2): Permission denied QNAP 的回复,请将 QNAP 的 NFS 主机访问设置中的任何主机名调整为 IP 地址!

    尤其是关于主机名与 IP 地址的最后一点是这里最大的障碍!我不知道为什么现在需要这样做,因为它在 Ubuntu 22.04 上可以正常使用主机名,并且机器仍然具有正确配置的相同主机名。

    希望这对其他人也有帮助。

    • 0

相关问题

  • 为 NFS 导出加密文件夹

  • Ubuntu 和 Windows Server 2008 NFS

  • 如何使用 GUI 设置 NFS 共享?

  • 如何在本地磁盘上缓存 NFS 共享?

  • 从共享 NFS /home 到完整的 LDAP 解决方案

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve