LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-22-2013, 09:50 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,396

Rep: Reputation: 101Reputation: 101
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
 
Old 12-23-2013, 05:57 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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.

Last edited by jpollard; 12-23-2013 at 05:59 AM.
 
Old 12-23-2013, 09:11 AM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,396

Original Poster
Rep: Reputation: 101Reputation: 101
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.

Last edited by taylorkh; 12-23-2013 at 09:14 AM.
 
Old 12-23-2013, 10:14 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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".
 
Old 12-23-2013, 12:01 PM   #5
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,396

Original Poster
Rep: Reputation: 101Reputation: 101
Thanks again jpollard. That did the trick 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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mounting pendrive on virtual machine Siddharth Sharma Linux - Virtualization and Cloud 8 02-21-2013 10:11 AM
Mounting DVD_Rom In Linux ( VMWare Virtual Machine) azhar5 Linux - Newbie 3 02-06-2010 05:09 AM
mounting samba filesystem on remote machine as /home on local machine shishirkotkar Linux - Software 1 04-28-2008 06:05 AM
Mounting NFS Share To Another Machine mijohnst Linux - Networking 8 06-24-2005 11:30 AM
Mounting NFS filesystem fstab vs autofs rrich100 Linux - Networking 0 11-13-2003 02:38 PM


All times are GMT -5. The time now is 10:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration