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

2021-05-19 01:32:38 +08:00
 ETONG

各位有没有 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

2673 次点击
所在节点    程序员
13 条回复
littlewing
2021-05-19 02:15:07 +08:00
你这个命令没有问题,Ubuntu 20.04 上亲测可以正常挂载,服务端 TrueNAS
vk42
2021-05-19 02:37:56 +08:00
服务器端和客户端配置?具体报错信息?最烦这种抱怨式求助,浪费自己和别人时间……
ETONG
2021-05-19 03:09:44 +08:00
@littlewing 大佬 把你的命令贴出来 我看一下是不是我写错了
ETONG
2021-05-19 03:12:47 +08:00
@littlewing 不知道 是不是我路径写错了 nfs 的写法和 smb 好像不一样
ETONG
2021-05-19 03:18:14 +08:00
@vk42 mount.nfs: access denied by server while mounting 192.168.2.66:/mnt/other
noqwerty
2021-05-19 04:15:15 +08:00
mount 加上-vvv 看一下详细报错信息
vk42
2021-05-19 05:11:02 +08:00
@ETONG 检查下服务器端配置,有没有限制客户端 IP 范围
aru
2021-05-19 06:42:06 +08:00
exports 写的不对吧。
服务器上会有更详细的出错日志
oyasumi
2021-05-19 08:01:45 +08:00
```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
2021-05-19 08:09:31 +08:00
@jiangwenwenmodes
不好意思,看错了。权当参考
ik
2021-05-19 09:20:47 +08:00
showmount -e 192.168.2.66
看看,我也怀疑 2.66 上没设置好
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
2021-05-19 10:05:25 +08:00
一般是服务端宕了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/777795

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX