# NFS: filesystem behaves as readonly when mounted as read-write

**URL:** <https://community.learnlinux.tv/t/nfs-filesystem-behaves-as-readonly-when-mounted-as-read-write/1386>\
**Category:** Linux on Servers\
**Created:** [February 6, 2022, 6:34pm UTC](https://community.learnlinux.tv/t/nfs-filesystem-behaves-as-readonly-when-mounted-as-read-write/1386 "2022-02-06T18:34:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwsmit](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/kwsmit/32/517_2.png) [@kwsmit](https://community.learnlinux.tv/u/kwsmit)\
**Post date:** [February 6, 2022, 6:34pm UTC](https://community.learnlinux.tv/t/nfs-filesystem-behaves-as-readonly-when-mounted-as-read-write/1386/1 "2022-02-06T18:34:18Z")

</div>

I’m reading Jay’s book Mastering Ubuntu Server with much pleasure. But I ran into something for which I could use some help or more explanation. It’s about creating an NFS share on a server and accessing it from a client.

I have a server running Ubuntu 20.04 (ksm-server1) and a client running Ubuntu 20.04 (pc2-kees). I followed all steps written by Jay in his book (“Setting up NFS shares”). On the server I created two folders in /exports: /exports/public and /exports/documents. My /etc/exports file on ksm1-server looks like this:

```auto
/exports *(ro,fsid=0,no_subtree_checks)
/exports/documents *(ro,no_subtree_checks)
/exports/public *(rw,no_subtree_checks)

```

Note that the public folder is ‘rw’ and the documents folder is ‘ro’. The parent folder ‘/exports’ is ‘ro’ as well, just like the example in the book.

On the client I can mount these shares successfully to /mnt/documents and /mnt/public. But when trying to change a file in the /mnt/public folder on the client, I’m getting an error message saying that the filesystem is read-only. I cannot write to it.

The solution I found is to set the parent folder on the server (/exports) to ‘rw’ as well. Than the /etc/exports file looks like this:

```auto
/exports *(rw,fsid=0,no_subtree_checks)
/exports/documents *(ro,no_subtree_checks)
/exports/public *(rw,no_subtree_checks)

```

This way the public folder mounted on the client is read-write. I found somewhere on internet that any settings in /etc/exports for a child folder should overrule the settings of its parent folder. But in my case, it doesn’t behave that way: when the parent folder (/exports) is set to ‘ro’ , then the child folder (/exports/public) will be ‘ro’ as well, no matter its own settings.

Do I misunderstand something, is it a bug or something else? Any help is welcome, thanks!
