# NFS Mount : Permission denied...



## Swissnic (Mar 24, 2017)

Hi all,

Sorry for this really, newbie question - but I am only 3 days old in my FreeBSD life, and learning so much. This is the first issue I am having problems with...

I have a Synology NAS with a number of shares, and all my data. I have configured the NAS with NFS, and given each share generic R/W rights.

I have created the mount point, and edited the fstab file to reflect what I wanted to do:

```
10.66.0.1:/volume1/Backup       /nas/backup     nfs     rw,tcp,intr,noatime,nfsv3,-w=32786,-r=32768     0       0
10.66.0.1:/volume1/music        /nas/music      nfs     rw,tcp,intr,noatime,nfsv3,-w=32786,-r=32768     0       0
10.66.0.1:/volume1/Personal     /nas/personal   nfs     rw,tcp,intr,noatime,nfsv3,-w=32786,-r=32768     0       0
10.66.0.1:/volume1/photo        /nas/photo      nfs     rw,tcp,intr,noatime,nfsv3,-w=32786,-r=32768     0       0
10.66.0.1:/volume1/Software     /nas/software   nfs     rw,tcp,intr,noatime,nfsv3,-w=32786,-r=32768     0       0
10.66.0.1:/volume1/video        /nas/video      nfs     rw,tcp,intr,noatime,nfsv3,-w=32786,-r=32768     0       0
```

The shares seem to mount correctly...


```
Filesystem                    1K-blocks       Used       Avail Capacity  Mounted on
zroot/ROOT/default             48363812    4792160    43571652    10%    /
devfs                                 1          1           0   100%    /dev
procfs                                4          4           0   100%    /proc
zroot/tmp                      43571764        112    43571652     0%    /tmp
zroot/usr/home                 48165460    4593808    43571652    10%    /usr/home
zroot/usr/ports                44302912     731260    43571652     2%    /usr/ports
zroot/usr/src                  44224120     652468    43571652     1%    /usr/src
zroot/var/audit                43571740         88    43571652     0%    /var/audit
zroot/var/crash                43571740         88    43571652     0%    /var/crash
zroot/var/log                  43571928        276    43571652     0%    /var/log
zroot/var/mail                 43571764        112    43571652     0%    /var/mail
zroot/var/tmp                  43571740         88    43571652     0%    /var/tmp
zroot                          43571740         88    43571652     0%    /zroot
fdescfs                               1          1           0   100%    /dev/fd
/dev/ada0p1                 15137202976         32 13926226708     0%    /das
10.66.0.1:/volume1/Backup    5804659768 4205667208  1598873776    72%    /nas/backup
10.66.0.1:/volume1/music     5804659768 4205667208  1598873776    72%    /nas/music
10.66.0.1:/volume1/Personal  5804659768 4205667208  1598873776    72%    /nas/personal
10.66.0.1:/volume1/photo     5804659768 4205667208  1598873776    72%    /nas/photo
10.66.0.1:/volume1/video     5804659768 4205667208  1598873776    72%    /nas/video
10.66.0.1:/volume1/Software  5804659768 4205667208  1598873776    72%    /nas/software
```

But I can only get access via a sudo(8) command:


```
nicholas@5600:/nas % pwd
/nas
nicholas@5600:/nas % ls -l software
total 0
ls: software: Permission denied
nicholas@5600:/nas % sudo ls -l software
total 237056
drwxrwxrwx  15 1026  100      4096 Mar  4 12:38 APPS
drwxrwxrwx   3 1026  100      4096 Mar  4 12:49 AV
drwxrwxrwx   3 1026  100      4096 Mar  4 12:49 BIOS
drwxrwxrwx   4 1026  100      4096 Mar  4 12:49 Backup
drwxrwxrwx   5 1026  100      4096 Mar  4 12:49 Boot-CD
nicholas@5600:/nas %
```


I know I am missing setting some permission somewhere, but for all the `chmod 777` commands I issue, nothing seems to change!

A pointer in the right direction would really e appreciated!

Also - sorry for posting this in Networks if it should be in Storage?  As this issue spans both camps - I thought I'd start here!

Cheers,

Nic.


----------



## sk8harddiefast (Mar 24, 2017)

You must first start up the NFS service on you client (Your FreeBSD machine in this case)

Try to put this on /etc/rc.conf (I guess you did)


```
nfs_client_enable="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"
```

Also on /etc/fstab try just to give this


```
10.66.0.1:/volume1/Backup       /nas/backup     nfs     rw      0       0
10.66.0.1:/volume1/music        /nas/music      nfs     rw      0       0
10.66.0.1:/volume1/Personal     /nas/personal   nfs     rw      0       0
10.66.0.1:/volume1/photo        /nas/photo      nfs     rw      0       0
10.66.0.1:/volume1/Software     /nas/software   nfs     rw      0       0
10.66.0.1:/volume1/video        /nas/video      nfs     rw      0       0
```

FreeBSD uses NFSv4 on client.

This is my config if that helps

On my server

My /etc/exports


```
/newmount/laptop1TB -mapall=emberonas 192.168.1.18 192.168.1.108
/newmount/laptop1TB -mapall=emberonas 192.168.1.18 192.168.1.108
/newmount/seagate1TB -mapall=emberonas 192.168.1.18 192.168.1.108
/newmount/seagate1TBad -mapall=emberonas 192.168.1.18 192.168.1.108
/newmount -mapall=emberonas 192.168.1.18 192.168.1.108
```

My /etc/rc.conf


```
rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"
mountd_enable="YES"
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
```

On my Client (My FreeBSD desktop)

My /etc/hosts


```
192.168.1.4     NAS
```


My /etc/rc.conf


```
nfs_client_enable="YES"
rpc_statd_enable="YES"
rpc_lockd_enable="YES"
```

My /etc/fstab


```
192.168.1.4:/newmount/laptop1TB /mnt/NAS/laptop1TB      nfs     rw      0       0
192.168.1.4:/newmount/seagate1TB /mnt/NAS/seagate1TB      nfs     rw      0       0
192.168.1.4:/newmount/seagate1TBad /mnt/NAS/seagate1TBad      nfs     rw      0       0
```


----------

