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 / 问题

问题[nfs](ubuntu)

Martin Hope
mschanne
Asked: 2023-12-15 23:38:03 +0800 CST

Ubuntu 22.04 NFS 服务器超时?

  • 5

我使用 Ubuntu NFS 服务器。我最近升级到 Ubuntu 22.04,它仅支持 TCP 上的 NFS。我看到服务器在 10 分钟后关闭连接,而我的客户端没有正确处理。这个超时时间是在哪里配置的?

nfs
  • 1 个回答
  • 29 Views
Martin Hope
719016
Asked: 2022-04-29 02:08:20 +0800 CST

无法在 Ubuntu 22.04 上挂载 nfs

  • 1

我已经在一台机器上安装了 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 个回答
  • 4633 Views
Martin Hope
Taux1c
Asked: 2021-02-16 20:16:15 +0800 CST

共享驱动器/文件夹

  • 0

我家里有一个 Ubuntu 服务器,它有一个静态的 up 和指向它的域。

我想分配一个在家庭网络上使用的文件夹作为共享文件夹,网络上的任何人都可以读写和执行。

我有 SSHFS 的经验和一点 NFS 的经验,我一直在尝试查找有关如何执行此操作的信息,但我没有发现任何有用的信息。大多数将访问驱动器的系统都是 Windows。但是,我也有一些 Linux 机器。所以我假设我需要使用 vfat 文件系统进行 fat32 格式化。

我的问题主要是我需要什么样的软件来做到这一点?我希望它自动显示在网络位置下。

预先感谢您的帮助!

nfs
  • 1 个回答
  • 55 Views
Martin Hope
Dmitry
Asked: 2021-02-05 11:38:26 +0800 CST

在 Ubuntu 20.x 服务器上为 NFS v3 设置静态端口

  • 3

我正在尝试在 Ubuntu 20.x 服务器上使用 NFSv3,并且需要设置静态端口才能使用 UFW。不幸的是,需要连接到此服务器的 Windows 10 仅支持 NFSv3,因此仅打开端口 2049 是不够的。

我尝试将端口添加到 /etc/default/nfs-kernel-server:

# Number of servers to start up
RPCNFSDCOUNT=64

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCMOUNTDOPTS="--manage-gids"

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=""

LOCKD_TCPPORT=32803
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
STATD_PORT=662
RQUOTAD_PORT=875

虽然配置确实需要 64 台服务器来启动,但即使在重新启动后,它也没有在底部拾取端口配置。

有谁知道我在哪里可以正确设置这些?

nfs
  • 1 个回答
  • 2098 Views
Martin Hope
user17911
Asked: 2020-09-27 09:38:40 +0800 CST

如何将 mount.cifs 授予普通用户以及注销前是否强制卸载

  • 0

操作系统:Ubuntu MATE 20.04.1 x64_86

我需要为文件服务器(具有 NFS 和 Microsoft Active Directory 的环境)创建一个网络驱动器,并能够通过 Bash 脚本对其进行读/写。经过一番谷歌搜索,我找到了一个解决方案(以下是我的 Bash 脚本中安装驱动器的更大程序的一部分):

readonly srv_conn_str="//remote-usrs-srv/Users$"
mount.cifs "${srv_conn_str}" ~/drive_usr -o username="${user}",password="${password}",dom="AD",vers=1.0

上面的代码完成了这项工作,但当且仅当我使用 sudo(root 特权)运行 mount.cifs 时它才有效。现在的问题是,这个 Ubuntu 系统实际上是一个带有 GUI 的虚拟机,多个用户连接到该虚拟机。这些用户中的每一个都需要在他们的~/drive_usr目录中创建挂载点(使用他/她的 Windows 帐户 ID 和密码)。因此,除非每个人都有 sudo 用户的密码,否则我看不到任何其他方式来运行此命令,显然这不是一个选项。因此,我有两个问题:

问题 1:是否有任何系统级配置允许以普通用户身份运行 mount.cifs 而不仅仅是系统管理员?

问题2:在每个用户关闭当前会话之前,应该~/drive_usr通过umount命令卸载吗?现在我问这个问题的原因显然是我真的是这个领域的初学者,所以我不知道在不卸载已经安装的网络驱动器的情况下关闭会话是否mount.cifs会对遥控器上的原始数据造成任何损害服务器,就好像我们在没有先卸载它的情况下移除了 U 盘,这是不推荐的,可能会导致数据丢失。


编辑n°1:(基于建议的解决方案钒)

我将以下行附加到 /etc/fstab:

//remote-usrs-srv/Users$   /home/mylinux_username/drive_usr    cifs user,noauto,rw,suid,exec,dev,iocharset=utf8,username=my_windows_username,domain=AD,vers=2.0                            0            0

这几乎解决了这个问题。现在,不使用 sudo我需要做的就是在我的 Bash 脚本中运行以下命令:

readonly srv_conn_str="//remote-usrs-srv/Users$"
mount.cifs "${srv_conn_str}" ~/drive_usr

一旦用户的 Windows 密码在我的脚本中作为命令行参数提供,它就会安装驱动器。但是,仍然存在两个问题:

  1. 我可以在不使用 sudo 的情况下挂载,但显然umount 命令仍然需要 sudo。我需要的是能够在没有 sudo 权限的情况下在 ~/drive_usr 上运行 mount 和 umount 。

  2. 最初,我在 /etc/fstab 中提供的选项中添加了异步选项。然而,这产生了以下错误:

    安装错误(22):参数无效

当我运行 dmesg 以查看问题时,这是我发现的错误消息:

CIFS: Unknown mount option "async"

那我理解正确吗?CIFS 与异步不兼容?我想添加 async 选项的原因是,当我在谷歌上搜索更多关于 /etc/fstab 的信息时,我看到很多人建议添加这个选项以提高性能,我真的是这个领域的初学者,我不知道这是否正确。我很感激对此的一些澄清。

server permissions samba mount nfs
  • 1 个回答
  • 704 Views
Martin Hope
philld
Asked: 2020-09-08 08:41:05 +0800 CST

NFS 在连接到 NordVPN 后停止响应

  • 2

升级后几天前开始出现此问题。当问题开始时,我正在运行 18.04。如果最新的 ubuntu 版本解决了这个问题,我升级到 20.04 但问题仍然存在。

执行“nordvpn 连接”后,我收到消息“文件系统没有响应”并且我的 NFS 共享被识别。从那时起,唯一会响应的应用程序是进行“连接”的终端窗口。如果有另一个应用程序打开,它只会在断开连接后响应。

如果它是 nordvpn 程序本身,我将其删除并按照 nordvpn.com 上的说明重新安装,但没有任何变化。联系了 Nordvpn 帮助台,他们让我刷新了防火墙缓存,但仍然是同样的问题。

在运行“nordvpn connect”之前或在执行“nordvpn disconnect”之后,我可以毫无问题地运行其他程序并毫无问题地访问 NFS 文件系统。

我错过了什么?

NFS 服务器是 192.168.0.51,连接到 NFS 共享的 VM 机器是 192.168.0.81(在 nordvpn 连接之前),然后它在“连接”之后收到一个 10. 地址。IP的变化会导致问题吗?

networking nfs
  • 1 个回答
  • 693 Views
Martin Hope
Oracle 911
Asked: 2020-07-30 12:10:55 +0800 CST

用于 Ubuntu 主机服务器 20.04 的 NFS

  • 0

我计划按照本手册设置我的 NFS 服务器: https ://quidsup.net/tutorials/?p=nfs

我只是不知道它有多过时以及如果我的本地地址是要修改什么:

192.162.1.100

我想要共享的 RAID 安装在:/mnt/rdisk

编辑:我有 webmin。

Edit2:这是一个本地网络,我不打算使用互联网。

Edit3:根据发布的教程,配置文件中的命令可以是:

/mnt/rdisk  192.168.1.0/255.255.255.0(rw,sync,root_squash,subtree_check)
nfs
  • 1 个回答
  • 297 Views
Martin Hope
James Bradbury
Asked: 2020-07-07 16:18:21 +0800 CST

NFS 共享可从 Nautilus 访问,但不能从应用程序访问

  • 4

我在使用 NFS 通过家庭 LAN 访问小型 PC 上的文件时遇到了一些问题。

当我使用 Nautilus 或命令行时,它似乎工作得很好,但是当我尝试保存 LibreOffice 或 GIMP 等应用程序时,我得到了几秒钟的延迟,然后是“写入错误”。从 NFS 共享打开现有文件时,它告诉我“此文件已锁定,无法由未知用户编辑”。

这些应用程序可以毫无问题地打开和保存本地驱动器上的文件。

我目前的解决方法是以只读方式打开并将文件保存到我的桌面上,然后使用 Nautilus 将其复制到我最初打开它的位置。

我的本地 PC 使用的是 Ubuntu 20.04,服务器说它在:“5.3.0-53-generic #47~18.04.1-Ubuntu SMP”

我的本地 /etc/fstab 条目:

192.168.50.186:/nas/shared /shared nfs rsize=8192,wsize=8192,timeo=14,hard,nfsvers=3

在服务器上我的 /etc/exports 文件:

/nas/shared   192.168.50.186/255.255.255.0(rw,insecure,no_subtree_check,async)

在 18.04 中,这个问题只影响了 LibreOffice,但现在它也影响了 GIMP 和 Krita 以及可能其他的。

nautilus server nfs 18.04 20.04
  • 2 个回答
  • 594 Views
Martin Hope
vagamens
Asked: 2020-06-28 12:21:46 +0800 CST

引导 PXE 时 Ubuntu 20.04 LTS 不挂载 NFS

  • 1

我一直在尝试让 Ubuntu 20.04 启动 PXE,并且遇到了与这里的其他人类似的问题。我找到了一些解决方案,包括添加ip=dhcp到pxelinux.cfg/default文件中的附加行,但它仍然拒绝启动。我已经包含了错误和我的菜单以供参考。非常感谢任何和所有帮助。

(initramfs) DHCPOFFER of 10.0.0.25 from 10.0.0.1
DHCPREQUEST for 10.0.0.25 on enp0s3 to 255.255.255.255 port 67 (xid=0x6cb408a3)
DHCPACK of 10.0.0.25 from 10.0.0.1 (xid=0xa308b46c)
bound to 10.0.0.25 -- renewal in 2557 seconds.
Begin: Running /scripts/casper-premount ... done
done.
Begin: Trying to netboot from 10.0.0.9:/netboot/ubuntu/20.04/server ... Begin: Trying nfsmount -o nolock -o ro 10.0.0.9:/netboot/ubuntu/20.04/server /cdrom ... done.
Unable to find a live file system on the network.

还有菜单:

default vesamenu.c32
prompt 0
timeout 300
ONTIMEOUT 1

menu title ########## OS Deploy ##########
label 1
       menu label ^1) Ubuntu 20.04 Server
       kernel ubuntu/20.04/server/casper/vmlinuz
       initrd ubuntu/20.04/server/casper/initrd
       append ip=dhcp boot=nfs nfsroot=10.0.0.9:/netboot/ubuntu/20.04/server ro nosplash ---

一切似乎都正常工作,直到 initramfs 挂载 nfs 共享(已导出并在网络上可用),此时它尝试挂载但未能挂载。

此外,我可以键入它打印到 stdout 的 nfsmount 命令,它会很好地挂载 nfs 共享,让我可以像我期望的那样浏览共享。

编辑:我已经取得了一些进展。设置 nfsboot=nfs 和 boot=casper 是不正确的。nfsboot不应该存在,boot=casper应该存在boot=nfs。我已经在pxelinux.cfg/default这里和我的 pxe 引导服务器上编辑了这两个文件。

我现在遇到了一个单独的问题,在 squashfs 中无法安装,如下所示:

[    6.596619] /root/cdrom/casper/extras/modules.squashfs-generic: Can't open blockdev
mount: mounting /root/cdrom/casper/extras/modules.squashfs-generic on /root/usr/lib/modules failed: Invalid argument
mount: mounting /dev on /root/dev failed: no such file or directory
mount: mounting /dev on /root/dev failed: No such file or directory
done.
mount: mounting /run on /root/run failed: No such file or directory
run-init: can't execute '/sbin/init': No such file or directory
Target filesystem doesn't have requested /sbin/init.
run-init: can't execute '/sbin/init': No such file or directory
run-init: can't execute '/etc/init': No such file or directory
run-init: can't execute '/bin/init': No such file or directory
run-init: can't execute '/bin/sh': No such file or directory
run-init: can't execute '': No such file or directory
No init found. Try passing init= bootarg

从这个日志输出中,我假设作为根本原因的行是读取的行[ 6.596619] /root/cdrom/casper/extras/modules.squashfs-generic: Can't open blockdev

这条线告诉我 squashfs 没有正确安装,这导致了所有其他问题。所以我现在的问题是,如何让 squashfs 正确安装?

boot mount pxe nfs 20.04
  • 2 个回答
  • 5792 Views
Martin Hope
Matthew Thompson
Asked: 2020-06-23 07:31:22 +0800 CST

如何确定内核错误补丁何时/是否将正式进入 18.04?

  • 0
Bug: unable to handle page fault for address: ffffffffffffffb0. Upstream commit 29fe839976266bc7c55b927360a1daae57477723

https://lkml.org/lkml/2020/5/18/1162 https://github.com/torvalds/linux/commit/29fe839976266bc7c55b927360a1daae57477723

在 Google Compute Engine 上运行 Ubuntu 5.3 gcp 内核。

kernel nfs 18.04
  • 1 个回答
  • 72 Views

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