# NFS server with external USB hard drive



## monkeys (Sep 3, 2012)

Hi guys,

So I have NFS setup on my FreeBSD 9 machine, and it functions perfectly well for exported shares from the root filesystem. However what I would like to do is export a share from a my external usb hard drive. 

My /etc/exports currently reads:


```
/mnt/stuffs/ -ro -network 192.168.1.0 -mask 255.255.255.0
```

This did not work even when I put no restrictions on access and /etc/exports read


```
/mnt/stuffs/ -ro
```

/mnt/stuffs is the mount point for hard drive partition /dev/da0s1 

When I attempt to mount this from either localhost or a linux machine I get a permission denied error: 


```
mount.nfs: timeout set for Mon Sep  3 09:39:03 2012
mount.nfs: trying text-based options 'vers=4,addr=192.168.1.158,clientaddr=192.168.1.8'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=192.168.1.158'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.1.158 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.1.158 prog 100005 vers 3 prot UDP port 935
mount.nfs: mount(2): Permission denied
mount.nfs: access denied by server while mounting monkey:/mnt/stuffs
```

And from /var/log/messages:

```
mountd[1320]: mount request denied from 192.168.1.8 for /mnt/stuffs
```


----------



## SirDice (Sep 3, 2012)

You're only getting a permission denied on UDP, TCP seems to work.


----------



## monkeys (Sep 3, 2012)

If it were working on TCP, I would have the share mounted on the client machine would I not? I do not.

And thank you for fixing the formatting for me. I was being dumb and read the formatting rules _after_ posting...


----------



## SirDice (Sep 3, 2012)

Make sure both nfsd(8) and mountd(8) are send a HUP signal after you've made changes to /etc/exports. Verify the exports(5) with the showmount(8) command.


----------



## monkeys (Sep 3, 2012)

When I run `showmount -e` I do get the expected output of: 

```
Exports list on localhost:
/mnt/stuffs/                       192.168.1.0
```

I have sent the HUP signals to refresh the changes from /etc/exports but still nothing.


----------



## sa (Sep 4, 2012)

Remove slash after pathname in your /etc/exports.


----------

