V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
ETONG
V2EX  ›  程序员

崩溃了, nfs 挂载半天挂载不上去,各种报错,不是 mount.nfs mount system call failed 就是其他奇怪的问题。教程都看了,版本也切换了就是不行,我看教程上的挂载参数比 smb 还少,救救孩子吧

  •  
  •   ETONG · 2021-05-19 01:32:38 +08:00 · 2665 次点击
    这是一个创建于 1073 天前的主题,其中的信息可能已经有所发展或是发生改变。

    各位有没有 2021 年适合的教程 我的环境是这样的 truenas 做服务端 开启了 nfs 也分配了权限,然后 ubuntu 是客户端来连接 truenas

    实际试用 smb 可以正常使用挂载,

    但是 nfs 死活不行!!!救救孩子 我看了这些教程: https://help.ubuntu.com/community/SettingUpNFSHowTo

    https://www.answertopia.com/ubuntu/using-nfs-to-share-ubuntu-files-with-remote-systems/

    https://linuxhint.com/ubuntu_20-04_-mounting_nfs/

    https://blog.csdn.net/HandsomeHong/article/details/81010457

    mount -t nfs 10.10.0.10:/backups /var/backups

    13 条回复    2021-05-19 10:05:25 +08:00
    littlewing
        1
    littlewing  
       2021-05-19 02:15:07 +08:00
    你这个命令没有问题,Ubuntu 20.04 上亲测可以正常挂载,服务端 TrueNAS
    vk42
        2
    vk42  
       2021-05-19 02:37:56 +08:00
    服务器端和客户端配置?具体报错信息?最烦这种抱怨式求助,浪费自己和别人时间……
    ETONG
        3
    ETONG  
    OP
       2021-05-19 03:09:44 +08:00
    @littlewing 大佬 把你的命令贴出来 我看一下是不是我写错了
    ETONG
        4
    ETONG  
    OP
       2021-05-19 03:12:47 +08:00
    @littlewing 不知道 是不是我路径写错了 nfs 的写法和 smb 好像不一样
    ETONG
        5
    ETONG  
    OP
       2021-05-19 03:18:14 +08:00
    @vk42 mount.nfs: access denied by server while mounting 192.168.2.66:/mnt/other
    noqwerty
        6
    noqwerty  
       2021-05-19 04:15:15 +08:00 via Android
    mount 加上-vvv 看一下详细报错信息
    vk42
        7
    vk42  
       2021-05-19 05:11:02 +08:00
    @ETONG 检查下服务器端配置,有没有限制客户端 IP 范围
    aru
        8
    aru  
       2021-05-19 06:42:06 +08:00
    exports 写的不对吧。
    服务器上会有更详细的出错日志
    oyasumi
        9
    oyasumi  
       2021-05-19 08:01:45 +08:00 via Android
    ```shell
    # 查看硬盘状态
    sudo fdisk -l
    df -h

    #创建目录然后挂载上去
    sudo mkdir /home/pi/seagate
    sudo mount /dev/sda1 /home/pi/seagate

    # 再次查看硬盘状态
    df -h

    #安装 NTFS 格式可读写软件。
    sudo apt install ntfs-3g

    # 加载内核模块。
    modprobe fuse

    # 设置开机自动挂载
    sudo vi /etc/fstab
    /dev/sda1 /home/pi/seagate ntfs-3g defaults,nofail,noexec,umask=0000 0 0

    # 取消挂载
    umount /dev/hda5
    ```
    oyasumi
        10
    oyasumi  
       2021-05-19 08:09:31 +08:00 via Android
    @jiangwenwenmodes
    不好意思,看错了。权当参考
    ik
        11
    ik  
       2021-05-19 09:20:47 +08:00 via iPhone
    showmount -e 192.168.2.66
    看看,我也怀疑 2.66 上没设置好
    vonsy
        12
    vonsy  
       2021-05-19 09:21:18 +08:00
    // 2.2.2.7,Ubuntu 20.04.2 LTS
    cat /etc/exports
    /zion *(ro,fsid=0,sync,crossmnt,no_subtree_check,all_squash,hide)
    /zion/share *(rw,fsid=1,sync,subtree_check,all_squash,insecure)

    // 2.2.2.6,Ubuntu 20.04.2 LTS
    cat /etc/fstab
    2.2.2.7:/zion/share /zion nfs rsize=32768,wsize=32768,timeo=900,intr

    // macOS Big Sur
    sudo mount -t nfs4 -w -o sync,nosuid,nolocks,noatime,resvport,vers=4,nfsvers=4,soft,intr,rsize=32768,wsize=32768,timeo=900,retrans=3,proto=tcp -v 2.2.2.7:/zion/share /private/nfs

    For NFSv4, there is a distinguished filesystem which is the root of all exported filesystem. This is specified with fsid=root or fsid=0 both of which mean exactly the same thing.

    https://linux.die.net/man/5/exports
    https://linuxconfig.org/how-to-set-up-a-nfs-server-on-debian-10-buster
    https://forums.macrumors.com/threads/since-upgrading-to-big-sur-i-can-not-longer-mount-remote-nfs-drives.2274862/
    jsutfun
        13
    jsutfun  
       2021-05-19 10:05:25 +08:00
    一般是服务端宕了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4883 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 09:50 · PVG 17:50 · LAX 02:50 · JFK 05:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.