2

I'm trying to build an NFS server on my Raspberry Pi which will be writable by any server on the network. The NFS share is a directory on an external device mounted at boot:

$ cat /etc/fstab
proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/mmcblk0p2  /               ext4    defaults,noatime  0       1

# This is my external device
/dev/sda1 /data                 ext4    defaults,nofail         0       2

I configured my /etc/exports as follows:

$ cat /etc/exports   
/data *(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
/data/share *(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)

The User ID and Group ID of 1000 is the pi user and pi group, which owns both /data and /data/share:

$ ls -la /data
total 28
drwxrwxrwx  4 pi   pi    4096 Sep 30 08:41 .
drwxr-xr-x 23 root root  4096 Oct  9 15:54 ..
drwx------  2 pi   pi   16384 Sep 25 14:57 lost+found
drwxrwxrwx  2 pi   pi    4096 Sep 30 08:41 share

When I try to mount the share from my Mac, I get the following error:

$ mount 192.168.101.10:/data tmp
mount_nfs: can't mount /data from 192.168.101.10 onto /Users/davejlong/Downloads/tmp: Operation not permitted

Here is the output of exportfs -v

$ sudo exportfs -v
/data           <world>(rw,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
/data/share     <world>(rw,wdelay,root_squash,all_squash,no_subtree_check,anonuid=1000,anongid=1000)

I'm not sure what I'm doing wrong with my configuration.

1

Of course I find my answer immediately after asking the question :facepalm:

It seems that I needed to add the insecure option to my exports:

$ cat /etc/exports   
/data *(rw,sync,all_squash,no_subtree_check,insecure,anonuid=1000,anongid=1000)
/data/share *(rw,sync,all_squash,no_subtree_check,anonuid=1000,anongid=1000)
  • I assume because it's a Mac. (The insecure option allows connections with a source port outside the 1-1000 range used by traditional unix. The traditional model generally won't hold anymore... it sounds like you want everyone on that network to have access so it's fine :). – sourcejedi Aug 1 '15 at 17:33

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.