mount: mounting on /mnt failed: Connection refused

Table of contents

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

I want to mount the Imx6ull development board to ubuntu. Teacher Wei Dongshan mounts it to a vmware virtual machine. I don’t use a virtual machine and directly use the ubuntu server. When I use the following command to mount, it prompts

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

I can ping each other between the Ubuntu server and the Linux development board. The problem is not here. After checking, I found that I forgot to configure /etc/exports. The operation is as follows.

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

Then the mount is successful again.

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

When I compiled the kernel, device tree and driver module, then replaced the kernel and driver of the imx6ull development board, then restarted the development board and mounted it again, the following error occurred.

 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

After looking at it, I found that ping 192.168.1.10 on the development board has failed. At this time, ifconfig on the development board found that there is no eth1.

 At this time use the following command

udhcpc  -i  eth1

This way you can get the IP address of eth1. then ifconfig

 Then just mount it again.

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

Execute the command again at a certain time

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

The following error is reported:

[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

The reason for the error is that my rootfs path has been changed on the server. It used to be /data1/chw/imx6ull_20230512/nfs_rootfs, and now it is /data/chw/imx6ull_20230512/nfs_rootfs, so I need to modify the /etc/exports file again.

After modification, you must use the following command to restart the nfs server, otherwise the mount will still report an error. 

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

Guess you like

Origin blog.csdn.net/u013171226/article/details/131086575