1

I was following a bunch of live sessions about how to setup an nfs server. I created the file exports in /etc/exports and the file contained the following:

/data    -rw     *(rw,no_root_sqush)

I have the directory and all the files of /data setup properly in there, I have started the nfs server.

systemctl start nfs

and it didn't return any errors, but when I tried to check the showmount for the /data I couldn't find any list of /data in the showmount

showmount -e localhost

this is what I get,

Export list for localhost:

but no /data in the list.

then I wanted to check the status of the nfs server since it didn't give any errors:

systemctl status -l nfs

and the result was:

    ● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: active (exited) since Mon 2017-03-13 04:09:47 EDT; 2min 44s ago
  Process: 4197 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 4193 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
 Main PID: 4197 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/nfs-server.service

Mar 13 04:09:47 dhcppc6 systemd[1]: Starting NFS server and services...
Mar 13 04:09:47 dhcppc6 exportfs[4193]: exportfs: /etc/exports:1: unknown keyword "no_root_sqush"
Mar 13 04:09:47 dhcppc6 systemd[1]: Started NFS server and services.

so whenever I try to mount the /data through:

mount localhost:/data /mnt

the result was

mount.nfs: access denied by server while mounting localhost:/data

Even though I'm accessing as a root.

Is there anything missing here that I did make while setting the nfs server that make me unable to mount its data?

Regarding the mounting: I have added the following line in /etc/auto.master:

/nfsserver      /etc/auto.nfsserver

and I created a new file /etc/auto.nfsserver and also added the line:

blah    -rw     localhost:/data

to prepare everything for the mounting, so I could mount the nfs server. But any help here would much appreciated.

Thank you

1 Answers1

1

The problem in the following line Is a typo:

/data    -rw     *(rw,no_root_sqush)

Mar 13 04:09:47 dhcppc6 exportfs[4193]: exportfs: /etc/exports:1: unknown keyword "no_root_sqush"

As in the manual

The only options that are permitted to vary in this way are ro, rw, no_root_squash, root_squash, and all_squash.

You should use no_root_squash instead

Yaron
  • 221
  • 2
  • 3
  • 15
  • Thanks a lot, I have dumped a lot of information, and disregarded the fact that it might be a typo. – Mohamed R. Abdelhameed Mar 13 '17 at 08:57
  • @MohamedR.Abdelhameed - happy to see that I helped you :) if my answer helped you please [accept](http://serverfault.com/help/accepted-answer) the answer – Yaron Mar 13 '17 at 08:59