NFS server on i.MX6 device

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NFS server on i.MX6 device

2,205 Views
yurirellosa
Contributor IV

I am trying to setup a shared folder from a i.MX6 device and mounting it to a i.MX28 device, but it just ends up with the following error:

Server/Host:(i,MX6)   Client:(i.MX28)

mount: RPC: Unable to receive; errno = Connection reset by peer

mount: mounting 192.168.0.140:/mnt/nfs on /mnt/nfsshare failed: Bad file descriptor

This is the mount command that I use

mount -t nfs 192.168.0.140:/mnt/nfs /mnt/nfsshare

I even tried, testing it by mounting it on the same board. I get the same error.

Commands [exportfs] and [showmount] show that it seems to work well.

Also below is the [/etc/exports] file content

/mnt/nfs 192.168.0.130(rw,sync,no_root_squash,no_subtree_check)

/mnt/nfs 127.0.0.1(rw,sync,no_root_squash,no_subtree_check)

NFS related Kernel config file look like below:

CONFIG_NETWORK_FILESYSTEMS=y

CONFIG_NFS_FS=y

CONFIG_NFS_V2=y

CONFIG_NFS_V3=y

# CONFIG_NFS_V3_ACL is not set

# CONFIG_NFS_V4 is not set

# CONFIG_NFS_SWAP is not set

CONFIG_ROOT_NFS=y

# CONFIG_NFSD is not set

CONFIG_NFS_USE_KERNEL_DNS=y

CONFIG_NFSD=y

CONFIG_NFSD_V2_ACL=y

CONFIG_NFSD_V3=y

CONFIG_LOCKD=y

CONFIG_LOCKD_V4=y

CONFIG_NFS_ACL_SUPPORT=y

CONFIG_NFS_COMMON=y

Any idea as to what is causing this error?

Am I missing any other configurations?

Best Regards

Yuri

0 Kudos
9 Replies

1,216 Views
b36401
NXP Employee
NXP Employee

It seems NFS server is unreachable from the client side.

Please make sure that your client (192.168.0.130) is able

to connect nfs server (192.168.0.140) via UDP

and NFS port is not disabled with firewall configuration.

Have a great day,

Victor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,216 Views
tonyzheng
NXP Employee
NXP Employee

Hi,

Can you run "ping" successfully?

0 Kudos

1,216 Views
yurirellosa
Contributor IV

For additional information I run the following commands:

root@imx6q-myboard:~# rpcinfo

   program version netid     address                service    owner

    100000    4    local     /var/run/rpcbind.sock  portmapper superuser

    100000    3    local     /var/run/rpcbind.sock  portmapper superuser

    100003    3    tcp       0.0.0.0.8.1            nfs        superuser

    100003    4    tcp       0.0.0.0.8.1            nfs        superuser

    100227    3    tcp       0.0.0.0.8.1            -          superuser

    100003    3    udp       0.0.0.0.8.1            nfs        superuser

    100003    4    udp       0.0.0.0.8.1            nfs        superuser

    100227    3    udp       0.0.0.0.8.1            -          superuser

    100021    1    udp       0.0.0.0.223.130        nlockmgr   superuser

    100021    3    udp       0.0.0.0.223.130        nlockmgr   superuser

    100021    4    udp       0.0.0.0.223.130        nlockmgr   superuser

    100021    1    tcp       0.0.0.0.190.156        nlockmgr   superuser

    100021    3    tcp       0.0.0.0.190.156        nlockmgr   superuser

    100021    4    tcp       0.0.0.0.190.156        nlockmgr   superuser

root@imx6q-myboard:~# rpcinfo -p

No remote programs registered.

root@imx6q-myboard:~# rpcinfo -p 192.168.0.140

   program vers proto   port  service

    100000    2   tcp    111  portmapper

    100024    1   udp  35734  status

    100024    1   tcp  42242  status

    100005    1   udp  37386  mountd

    100005    1   tcp  55494  mountd

    100005    2   udp  37386  mountd

    100005    2   tcp  55494  mountd

    100005    3   udp  37386  mountd

    100005    3   tcp  55494  mountd

root@imx6q-myboard:~# rpc

rpc.idmapd  rpc.nfsd    rpcbind     rpcinfo

rpc.mountd  rpc.statd   rpcclient

Is there a problem with portmap configurations? The [-p] is suppose to display host program right? But It says nothing is registered.

It also seems the system does not have [rpc.portmap] although [usr/bin/portmap] is present, are they related?

Best Regards

Yuri

0 Kudos

1,216 Views
isaac_ng
NXP Employee
NXP Employee

Could you try to add "-o nolock" as well.  Take reference from this: http://wiki.openwrt.org/doc/howto/nfs.client

0 Kudos

1,216 Views
yurirellosa
Contributor IV

Hello

Is there some sort of firewall or port opening configuration that I missed?

0 Kudos

1,216 Views
isaac_ng
NXP Employee
NXP Employee

Just tested with L3.10.53_1.1.0-GA release pre-built image for i.MX6QSDB board and the NFS mount is running.  Could try and then cross check your setup.

HW: i.MX6QSDB board

SW: fsl-image-qt5-x11-imx6qdlsolo.sdcard

Host Linux PC: Ubuntu 14.04 64bit OS with nfs packages installed:

$ sudo apt-get install nfs-common nfs-kernel-server

and added this to the /etc/exports:

/home/vmuser/ltib_src *(rw,no_root_squash)

Then, power up the i.MX6QSDB board with SD card programmed with the fsl-image-qt5-x11-imx6dqdlsolo.scard and then type the follows:

# mount -t nfs -o nolock 10.192.246.82:/home/vmuser/ltib_src/gpu-sdk /mnt

# mount

:

:

10.192.246.82:/home/vmuser/ltib_src/gpu-sdk on /mnt type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.192.246.85,local_lock=none,addr=10.192.246.82)

0 Kudos

1,216 Views
yurirellosa
Contributor IV

Thank you for looking into this. Sorry that I didn't make the setup clear.

Both the host(i.MX6) device and client(i.MX28) devices are i.MX devices.

I tried on both devices in mounting folders/file from a Host PC(Ubuntu 12.04) and there seem to be no errors.

The problem arises when the i.MX6 device is the server/host. I cannot connect from the i.MX28 device,

although the ping is fine and the i.MX28 device can [showmount] the shared folders from the i.MX6

Best Regards

Yuri

0 Kudos

1,216 Views
yurirellosa
Contributor IV

Hello

I have also tried those option with same results. Also tried specifying ports and proto.

One more thing, whenever I run the mount command and get the [Connection reset by peer] error, [showmount -e] does not display anything anymore.

I have to restart nfs on the server side for it to work again.. Is this normal behaviour?

(Btw, I have configured a samba server on the same device and the client device has no problem mounting and accessing the shared folder)

0 Kudos

1,216 Views
yurirellosa
Contributor IV

Hello,

Yes. And command [showmount] from the client lists the shared folders properly.

Only connecting to it seems to be the problem.

Best Regards

Yuri

0 Kudos