1

I'm trying to setup NFS between two Linux machines (embedded).

Foo(server) -> Bar(client)

I have nfs-utils (1.3.3) and the dependices installed on both machines. Here is the /etc/exports file on Foo.

/public 10.0.1.0/24(rw,insecure,async,no_subtree_check,no_root_squash,nohide)

/public is on the local filesystem and it's not encrypted.

FOO# findmnt -T /public
TARGET SOURCE      FSTYPE OPTIONS
/      ubi0:rootfs ubifs  rw,relatime

And starting the daemon:

FOO# /etc/init.d/S21-nfsd start
Mounting proc/fs/nfsd: [OK]
exportfs: /public does not support NFS export
Starting /sbin/portmap: [OK]
Starting /usr/sbin/rpc.statd: [OK]
Starting /usr/sbin/rpc.mountd: [OK]
Starting /usr/sbin/rpc.nfsd: [OK]
FOO# exportfs
/public         10.0.1.0/24
FOO# cat /proc/fs/nfs/exports
# Version 1.1
# Path Client(Flags) # IPs

With the above I'm not sure which to believe on if /public is really exported.

The directory has full permissions:

FOO# ls -ld /public
drwxrwxrwx    2 root     root           160 Jan 13  1990 /public

On the client I try to mount the NFS share:

BAR# mount -t nfs -vvvv FOO:/public /public
mount: FOO:/public failed, reason given by server: Permission denied
mount: mounting FOO:/public on /public failed: Bad file descriptor

I'm using the root account on both machines, and uids match:

FOO# id
uid=0(root) gid=0(root) groups=0(root)
BAR# id
uid=0(root) gid=0(root) groups=0(root)

Kernel support is there both machines as well, FOO->kernel 2.6.35, BAR->kernel 4.1.18:

FOO# zcat /proc/config.gz|grep "NFS"
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
# CONFIG_NFS_V4 is not set
CONFIG_ROOT_NFS=y
CONFIG_NFSD=y
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y

BAR# zcat /proc/config.gz | grep "NFS"
CONFIG_KERNFS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V2=y
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
# CONFIG_NFS_SWAP is not set
# CONFIG_NFS_V4_1 is not set
CONFIG_ROOT_NFS=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFSD is not set
CONFIG_NFS_ACL_SUPPORT=y
CONFIG_NFS_COMMON=y

Where is my issue? Client side? Server side?

  • Which kind of filesystem is /public on? Local? Remote? Encrypted? – andcoz Jul 24 '18 at 15:41
  • It's a local filesystem, it's not encrypted. – dangeroushobo Jul 24 '18 at 15:43
  • Can you add the output of findmnt -T /public? – andcoz Jul 24 '18 at 15:51
4

The Linux kernel on FOO is version 2.6.35 (from late 2011). It has support for UBIFS (your filesystem on the root partition, since kernel version 2.6.27 in 2008), but kernel support for exporting NFS mounts off of UBIFS was added at some point during 2016/2017.

This means that your FOO system won't be able to export /public until its kernel has been upgraded to a much later kernel, or until you move the directory to some other filesystem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.