Cannot create NFS on a tmpfs drive

mountnfsramdiskslestmpfs

OS: SLES 12.3

Running these commands:

mkdir /foo/ramdisk
mount -t tmpfs -o size=100m tmpfs /foo/ramdisk

Creating a NFS on /foo/ramdisk produces this result when I run showmount -e <IP>:

clnt_create: RPC: Program not registered

When I remove the NFS share then showmount -e <IP> works again:

Export list for …


Another strange fact:

When I create an NFS for /foo and I mount this NFS on another Linux/Windows PC then [on the PC where I mounted the NFS] there are no files visible in /foo/ramdisk and I am not allowed [yes, there are the correct permissions set] to write anything into the /foo/ramdisk directory.


I export the NFS with the SUSE tool yast and use these settings:

crossmnt,rw,no_root_squash,async,no_subtree_check


My question:

Isn't it allowed to export a ramdisk as NFS or what am I doing wrong?

Best Answer

I found the problem: I had to add to the NFS options fsid so now the full list looks like this:

fsid=1,crossmnt,rw,no_root_squash,async,no_subtree_check

The fact is yast doesn't warn here. I could fix the problem because I ran exportfs and then I got the error regarding the fsid.

Related Question