# NFS



## sprock (Aug 2, 2022)

Hello,

Just added  another line to /etc/exports and I'm getting this when running `mountd reload`:

```
can't change attributes for /: netcred already exists for given addr/mask
can't change attributes for /export: netcred already exists for given addr/ma
bad exports list line '/export -alldirs -maproot'
```
This is my /etc/exports file:

```
# For diskless FreeBSD 
/b -ro -alldirs -maproot=root -network 172.16.0.0/24 
/usr/home/rmason -network 172.16.0.0/24 

# For diskless NetBSD. 
/export -alldirs -maproot=root -network 172.16.0.0/24
```
I appreciate any help offered.

sprock
(who is beginning to hate NFS)


----------



## Jose (Aug 2, 2022)

You're attempting "to export a subdirectory of the root file system with the *-alldirs* option which is not allowed."

See exports(5). Yes, that man page sucks.


----------



## sprock (Aug 2, 2022)

Getting rid of -alldirs and -maproot has no effect:

/export -network 172.16.0.0/24

can't change attributes for /: netcred already exists for given addr/mask
can't change attributes for /export: netcred already exists for given addr/ma
minnie mountd[13173]: bad exports list line '/export -network 172.16.0.0/24'

Thanks,
sprock


----------



## Jose (Aug 2, 2022)

Are these ZFS filesystems by chance?


----------



## T-Daemon (Aug 2, 2022)

Set only one address/masklen line: `-network 172.16.0.0/24`

The other `-network` lines only address: `-network 172.16.0.0`


----------



## sprock (Aug 2, 2022)

For the record:

/export -maproot=root -network 172.16.0.0

produces no error, and 'showmount -e' shows that '/exports' is in the exports list:
Exports list on localhost: 
/b                                 172.16.0.0 
/export                         172.16.0.0 
/usr/home/rmason       172.16.0.0

and

/export -alldirs -maproot=root -network 172.16.0.0

produces no error but '/exports' is NOT in the exports list.
Exports list on localhost:

/b                                 172.16.0.0 172.16.0.0
/usr/home/rmason       172.16.0.0

Yes, the nfs server is running ZFS.

Thanks to both of you for your help.

sprock


----------



## Jose (Aug 3, 2022)

sprock said:


> For the record:
> 
> /export -maproot=root -network 172.16.0.0


According to the man page, this will set the netmask using the old classful scheme. You'll get a /16 netmask if the man page is correct. Obviously lots of it is not.



sprock said:


> Yes, the nfs server is running ZFS.


I asked because you can export ZFS filesystems using zfs-share(8). Apparently this is just a script that creates an /etc/zfs/exports. I was wondering if maybe there was a conflict between the two files.


----------

