# Can't get NFS to share USB drive.



## Qoo (Dec 21, 2015)

FreeBSD noob here so sorry if I'm just not configuring something correctly. Please help me out.

I have an external USB drive that I can't get FreeBSD to NFS share. It's mounted as NTFS-3G and shares across Samba without any problems but won't do NFS.

Here's the /etc/exports and /etc/rc.conf file.


```
/usr/home/abd/nDrive    -alldirs -maproot=user     192.168.0.12
```


```
hostname="Server_18"
ifconfig_re0="DHCP"
ifconfig_re0_ipv6="inet6 accept_rtadv"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"
mountd_enable="YES"
samba_enable="YES"
fusefs_enable="YES"
```
The /etc/fstab file from my other FreeBSD computer.

```
192.168.0.13:/usr/home/abd/nDrive    /RPi    nfs    rw    0    0
```
No access with Ubuntu either. The /etc/fstab file from Ubuntu

```
192.168.0.13:/usr/home/abd/nDrive    /home/julia/RPi/    nfs     rw     0    0
```


```
# showmount -e
Exports list on localhost:
/usr/home/abd/nDrive               192.168.0.12
```
This is the output from FreeBSD.

```
192.168.0.13:/usr/home/abd/nDrive: Permission denied
```
And the output from Ubuntu

```
mount.nfs: access denied by server while mounting 192.168.0.13:/usr/home/abd/nDrive
```
Without the drive mounted /usr/home/abd/nDrive gives me this and it does share under these permissions.

```
# ls -l
total 40
-rw-r--r--  1 abd   smb  1066 Dec 17 12:47 .cshrc
-rw-r--r--  1 abd   smb   252 Dec 17 12:47 .login
-rw-r--r--  1 abd   smb   163 Dec 17 12:47 .login_conf
-rw-------  1 abd   smb   379 Dec 17 12:47 .mail_aliases
-rw-r--r--  1 abd   smb   336 Dec 17 12:47 .mailrc
-rw-r--r--  1 abd   smb   817 Dec 17 12:47 .profile
-rw-------  1 abd   smb   281 Dec 17 12:47 .rhosts
-rw-r--r--  1 abd   smb   978 Dec 17 12:47 .shrc
-rw-r--r--  1 root  smb   545 Dec 20 08:42 log.txt
-rw-r--r--  1 root  smb     0 Dec 20 08:43 log1.txt
drwxrwxrwx  2 root  smb   512 Dec 18 05:44 nDrive
```
once the drive is mounted.

```
total 36
-rw-r--r--  1 abd   smb    1066 Dec 17 12:47 .cshrc
-rw-r--r--  1 abd   smb     252 Dec 17 12:47 .login
-rw-r--r--  1 abd   smb     163 Dec 17 12:47 .login_conf
-rw-------  1 abd   smb     379 Dec 17 12:47 .mail_aliases
-rw-r--r--  1 abd   smb     336 Dec 17 12:47 .mailrc
-rw-r--r--  1 abd   smb     817 Dec 17 12:47 .profile
-rw-------  1 abd   smb     281 Dec 17 12:47 .rhosts
-rw-r--r--  1 abd   smb     978 Dec 17 12:47 .shrc
-rw-r--r--  1 root  smb       0 Dec 20 08:42 log.txt
drwxrwxrwx  1 root  wheel  4096 Dec 18 15:11 nDrive
```
I've tried chmod and chown after the drive is mounted but the ownership remains the same and even with rwx priviledges, won't share.

Any help would be appreciated. Thanks in advance.

```
# service -e
/etc/rc.d/hostid
/etc/rc.d/hostid_save
/etc/rc.d/cleanvar
/etc/rc.d/ip6addrctl
/etc/rc.d/devd
/etc/rc.d/newsyslog
/etc/rc.d/syslogd
/etc/rc.d/rpcbind
/etc/rc.d/dmesg
/etc/rc.d/mountd
/etc/rc.d/nfsd
/etc/rc.d/virecover
/usr/local/etc/rc.d/samba
/etc/rc.d/motd
/etc/rc.d/ntpd
/etc/rc.d/powerd
/etc/rc.d/sshd
/etc/rc.d/sendmail
/etc/rc.d/cron
/etc/rc.d/moused
/etc/rc.d/mixer
/etc/rc.d/gptboot
/etc/rc.d/bgfsck
```


----------



## junovitch@ (Dec 26, 2015)

I'm not sure if it being a order of operations type situation with a FUSE mount has anything to do with this.  What happens if you `service mountd reload` after the system is fully up and running?  Does that change anything?


----------



## Qoo (Dec 27, 2015)

Thank you for responding. `showmount -e` gives me this and still with permission denied. It looks like something to do with Fuse. I reformatted the drive as UFS and it mounts fine with Samba & NFS. If I get time in the future maybe I'll try fiddling with fuse again and I'll update this post. Thanks again.

```
# showmount -e
Exports list on localhost:
/usr/home/abd/nDrive
```


----------



## junovitch@ (Dec 27, 2015)

You did try `service mountd reload` after the NTFS mountpoint was available, correct? If that didn't work then it could certainly have to do with where nfsd(8) acts to service requests to the file system. Samba is just a userland application and works a bit differently.


----------



## Qoo (Dec 27, 2015)

Sorry. Yes.  ^^^That's the `showmount -e` output I get right after running `service mountd reload`. What setting would cause it to deny the request? What settings would I try?


----------



## kpa (Dec 28, 2015)

My guess is that FUSE is the culprit here. Try to get the NFS sharing working on a standard non-FUSE filesystem first and then switch to the FUSE filesystem when you have that working.


----------



## Qoo (Dec 29, 2015)

That's where I'm guessing it is too or a user map conflict somewhere but since I reformatted it as UFS, it hasn't given me any problems.


----------

