mount: mounting on /mnt failed: Connection refused

目录

1 mount: mounting 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: Connection refused

2  mount -t nfs -o nolock,vers=3 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs /mntmount: mounting 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: No route to host

3 mount: mounting 192.168.1.10:/data/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: Permission denied


1 mount: mounting 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: Connection refused

想把Imx6ull开发板挂载到ubuntu上,韦东山老师是挂载到vmware虚拟机上,我不用虚拟机,直接用ubuntu服务器,在使用如下命令挂载时提示

mount -t nfs -o nolock,vers=3 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs  /mnt
mount: mounting 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: Connection refused

我再ubuntu服务器和Linux开发板上相互ping是可以通的,问题不在这,查了下发现忘记配置/etc/exports,操作如下

sudo apt-get install nfs-kernel-server

vim /etc/exports  #然后在/etc/exports增加如下一行内容
/data1/chw/imx6ull_20230512/  *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)

sudo /etc/init.d/nfs-kernel-server restart

然后再次挂载成功。

2  mount -t nfs -o nolock,vers=3 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs /mnt
mount: mounting 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: No route to host

当我编译了内核、设备树和驱动模块,然后把imx6ull开发板的内核和驱动都替换掉,然后重启开发板,再次挂载出现如下错误

 mount -t nfs -o nolock,vers=3 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs /mnt
mount: mounting 192.168.1.10:/data1/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: No route to host

看了下发现在开发板上ping 192.168.1.10已经不通了,这时候在开发板上ifconfig发现没有eth1了,

 这时候使用如下命令

udhcpc  -i  eth1

这样就可以获取eth1的IP地址。然后ifconfig

 然后再次挂载就可以了。

3 mount: mounting 192.168.1.10:/data/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: Permission denied

某一次再次执行命令

mount -t nfs -o nolock,vers=3 192.168.1.10:/data/chw/imx6ull_20230512/nfs_rootfs /mnt

报下面的错误:

[root@imx6ull:/mnt]# mount -t nfs -o nolock,vers=3 192.168.1.10:/data/chw/imx6ull_20230512/nfs_rootfs /mnt
mount: mounting 192.168.1.10:/data/chw/imx6ull_20230512/nfs_rootfs on /mnt failed: Permission denied

报错原因是服务器上我的rootfs换了路径,之前是/data1/chw/imx6ull_20230512/nfs_rootfs,现在是/data/chw/imx6ull_20230512/nfs_rootfs,所以我要重新修改/etc/exports文件,

修改完之后要用下面的命令重启nfs服务器,否则挂载还是报错 

sudo /etc/init.d/nfs-kernel-server restart

猜你喜欢

转载自blog.csdn.net/u013171226/article/details/131086575
今日推荐