LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Mounting an nfs filesystem RW from a virtual machine (https://www.linuxquestions.org/questions/linux-newbie-8/mounting-an-nfs-filesystem-rw-from-a-virtual-machine-4175488898/)

taylorkh 12-22-2013 08:50 PM

Mounting an nfs filesystem RW from a virtual machine
 
This should be simple but I am apparently overlooking something...

I have exported a directory on my CentOS 6.5 host (taylor12) with the following line in my /etc/exports file
Quote:

/data/test 192.168.0.248(sync,no_root_squash)
The IP address is the one assigned to my Ubuntu 12.04 virtual machine running in VMWare. The permissions on the exported directory are wide open
Quote:

drwxrwxrwx. 3 ken ken 4096 Dec 22 21:20 test
On the virtual machine I have created a directory /remote/test again with the permissions wide open. I then mount the nfs exported directory with the following line in /etc/fstab
Quote:

taylor12:/data/test /remote/test nfs auto 0 0
The mount works except that acts as if it is mounted as a read only file system.

I have nfs working between my Ubuntu 12.04 server and my CentOS 6.5 desktop. Someone please smack me in the head and tell me what I am overlooking.

TIA,

Ken

jpollard 12-23-2013 04:57 AM

UIDs match between the VM and server?

Also check that the security label on export allows it for write.

You can also check that the SELinux boolean flags permit NFS rw on the server.

taylorkh 12-23-2013 08:11 AM

Thanks jpollard,

I had checked the UIDs. I learned about that when moving from the Hat family to the 'buntu family some years ago. I manually set my UID on the CentOS machine to 1000 to match the Ubuntu machine.

I mounted an nfs export on the Ubuntu server from the Ubuntu VM. This works as expected. I can read and write to the Ubuntu server from the Ubuntu VM.

As a further test I mounted an nfs export on my Ubuntu server from a CentOS virtual machine on the CentOS host. My UID on the VM is 500 and on the Ubuntu machine is 1000. If I try to delete a file on the Ubuntu nfs from the CentOS VM I get an error message "Access Denied" not "Read only file system." So it smells like something on the CentOS host.

I am running Selinux in the permissive mode on the CentOS host as it is only a desktop PC. (I need to master Selinux some day but just not today). I believe that addresses your second and third suggestions. Must be something else.

Ken

p.s. I created an account on the CentOS VM with a UID of 1000. It can read and write the nfs export on the Ubuntu server. Further evidence that the UID is not the cause of the RO fs message.

jpollard 12-23-2013 09:14 AM

How about explicitly adding "rw" to the export options...

I don't know when the default changed, but my manpage on exports indicates it defaults to "ro".

taylorkh 12-23-2013 11:01 AM

Thanks again jpollard. That did the trick :D Interestingly the man page for Ubuntu 12.04 also says
Quote:

The default is to disallow any request which changes the filesystem.
I guess the British have a different definition of default or perhaps of change as I have never had to use the rw option when exporting an nfs file system on Ubuntu. I am now in business.

Merry Christmas, a Happy New Year and any other holiday you may celebrate!

Regards,

Ken


All times are GMT -5. The time now is 11:49 PM.