[Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

NFS write Error

I have an NFS server where /home is exported. On the Client I can mount the FS with NFS4. But I am not able to write anything on the NFS imported share.

On server:
# cat /etc/exports
/exports        *(ro,sync,insecure,root_squash,no_subtree_check,fsid=0)
/exports/home   *(rw,nohide,sync,insecure,root_squash,no_subtree_check)
# df -h |grep home
/dev/mapper/VolGroup00-home  194G   36M  184G   1% /home

On client
# df -h|grep home
Server:/home          194G   36M  184G   1% /home_new

I am able to see the files but I am not able to write to share from client

  • 2
2 Solutions
> /exports        *(ro,sync,insecure,root_squash,no_subtree_check,fsid=0)
On NFS server, take out this line.
# chmod 755 /exports
# exportfs -a
Is this related to (root_squash) , which cause root can not write it on the client side?

By default, root_squash is set,
If you want root on the client side to be able to write to NFS mount, you need to export as no_root_squash.
However, no_root_squash will cause root user on client side to delete the files on NFS share.
In man of "exports" is given exaple:

/home/joe       pc001(rw,all_squash,anonuid=150,anongid=100)

anonuid and anongid
              These options explicitly set the uid and gid of the anonymous account.   This  option  is  primarily  useful  for PC/NFS  clients, where you might want all requests appear to be from one user. As an example, consider the export entry for /home/joe in the example section below, which maps all requests to uid 150 (which is supposedly that of user joe).


/               master(rw) trusty(rw,no_root_squash)

       The  first  line  exports  the  entire  filesystem  to machines master and trusty.  In addition to write access, all uid squashing is turned off for host trusty.


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now