LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-21-2011, 02:03 AM   #1
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Rep: Reputation: 0
Can't mount NFS as writeable


This is my first time working with NFS but I fail to see what the issue is since everything works properly.

On the server (CentOS 5.5, virtualized), /etc/exports has

Quote:
/home/share 192.168.0.0/16 *(rw, sync)
I've exported the file using
Quote:
exportfs -ra
Then mounting it from the client with

Quote:
sudo mount 192.168.2.105:/home/share /mnt/nfs
It mounts perfectly fine but I can't write to the mounted NFS partition.

Everytime I try "touch t", I get touch:
Quote:
cannot touch `t': Read-only file system
Anyone knows how I can mount this in a manner where I can write to the mount? Also, if I had explicitly mentioned that the partition is to be mounted as rw, why is this happening?


BTW, showmount -e 192.168.2.105 shows the proper value, namely,

Quote:
showmount -e 192.168.2.105
Export list for 192.168.2.105:
/home/share (everyone)
 
Old 01-21-2011, 04:13 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,219

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Can you post result of commands
Code:
exportfs -v
mount
on the nfs server?
And
Code:
mount
on the client.

Last edited by eSelix; 01-21-2011 at 04:14 AM.
 
1 members found this post helpful.
Old 01-21-2011, 04:18 AM   #3
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Original Poster
Rep: Reputation: 0
Server:

Quote:
[root@centos01 ~]# exportfs -v
/home/share 192.168.0.0/16(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/home/share <world>(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@centos01 ~]# mount
/dev/sda5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda3 on /home type ext3 (rw)
/dev/sda1 on /boot type ext2 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /proc/fs/vmblock/mountPoint type vmblock (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
client:
Quote:
[steve@steve-laptop:~]$ mount (01-21 12:17)
/dev/sda3 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
none on /var/lib/ureadahead/debugfs type debugfs (rw,relatime)
gvfs-fuse-daemon on /home/steve/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=steve)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
 
Old 01-21-2011, 05:45 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,012

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
What is the output of ls -al /mnt ?
 
1 members found this post helpful.
Old 01-21-2011, 06:32 AM   #5
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,219

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
I mean mounts on client after mounting nfs:
Code:
sudo mount 192.168.2.105:/home/share /mnt/nfs
mount
 
1 members found this post helpful.
Old 01-21-2011, 02:07 PM   #6
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Original Poster
Rep: Reputation: 0
@tredegar

Quote:
ls -al /mnt
total 12
drwxr-xr-x 3 root root 4096 2011-01-21 22:01 .
drwxr-xr-x 24 root root 4096 2011-01-21 21:22 ..
drwxr-xr-x 2 nobody nogroup 4096 2011-01-20 19:36 nfs

@eSelix

Sorry:

Quote:
mount
/dev/sda3 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw)
none on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
none on /dev type devtmpfs (rw,mode=0755)
none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
none on /dev/shm type tmpfs (rw,nosuid,nodev)
none on /var/run type tmpfs (rw,nosuid,mode=0755)
none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
none on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
gvfs-fuse-daemon on /home/steve/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=steve)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
192.168.2.105:/home/share on /mnt/nfs type nfs (rw,addr=192.168.2.105)
Thanks guys
 
Old 01-21-2011, 03:25 PM   #7
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,219

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
You have
Code:
/home/share 192.168.0.0/16(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)

/home/share <world>(rw,wdelay,no_root_squash,no_subtree_check,anonuid=65534,anongid=65534)
Are you (client) in 192.168.0.0/16 subnet?
If yes, you get read only filesystem, I think the second entry <world> is not getted then into account.
 
1 members found this post helpful.
Old 01-21-2011, 03:29 PM   #8
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Original Poster
Rep: Reputation: 0
Holy!

I didn't realize that! Yes my client is in the 192.168.0.0/16 subnet. How would I go about solving this? As you can see from the original post, its set to rw.
 
Old 01-21-2011, 04:36 PM   #9
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,219

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Just set your /etc/exports like that:
Code:
/home/share 192.168.0.0/16(rw,sync)
if you do not want people outside your subnet to connect. And set permissions to /home/share that user with id=65534 which is usualy "nobody" has write permission, for example
Code:
chmod 777 /home/share
if you don't need special security. Or change anonuid option in exports file to other user id.

Last edited by eSelix; 01-21-2011 at 04:52 PM.
 
1 members found this post helpful.
Old 01-22-2011, 01:35 AM   #10
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Original Poster
Rep: Reputation: 0
Nope, still no go.

Changed the folder privileges to 777, mounted, unmounted and tried again and still won't write to the share. Checking from the client, ls -al gives me:

Quote:
total 12
drwxr-xr-x 3 root root 4096 2011-01-21 22:01 .
drwxr-xr-x 24 root root 4096 2011-01-22 08:46 ..
drwxrwxrwx 2 nobody nogroup 4096 2011-01-20 19:36 nfs
which explicitly states that all have rwx, but still won't write

Quote:
[steve@steve-laptop:/mnt/nfs]$ ls -al /mnt
total 12
drwxr-xr-x 3 root root 4096 2011-01-21 22:01 .
drwxr-xr-x 24 root root 4096 2011-01-22 08:46 ..
drwxrwxrwx 2 nobody nogroup 4096 2011-01-20 19:36 nfs
[steve@steve-laptop:/mnt/nfs]$ touch t.txt
touch: cannot touch `t.txt': Read-only file system
 
Old 01-22-2011, 06:42 AM   #11
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,219

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
Can you check "exportfs -v" on the server that there are really "rw" access?
 
1 members found this post helpful.
Old 01-22-2011, 07:07 AM   #12
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Original Poster
Rep: Reputation: 0
Hmm, you're right.

Check this out (all on the server):


Quote:
[root@centos01 ~]# exportfs -v
/home/share 192.168.0.0/16(ro,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
/home/share <world>(rw,wdelay,root_squash,no_subtree_check,anonuid=65534,anongid=65534)
[root@centos01 ~]# cat /etc/exports
/home/share 192.168.0.0/16 (rw,sync)
[root@centos01 ~]#
Why is this being exported as ro when its explicitly mentioned as rw??

I know that this shouldn't come into play, but just in case, the server is a virtual machine. That has nothing to do with it, right?
 
Old 01-22-2011, 07:16 AM   #13
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,219

Rep: Reputation: 307Reputation: 307Reputation: 307Reputation: 307
You have space between IP and parenthesis
Code:
/home/share 192.168.0.0/16 (rw,sync)
it should be without any space like this
Code:
/home/share 192.168.0.0/16(rw,sync)
 
1 members found this post helpful.
Old 01-22-2011, 07:19 AM   #14
Mustafa Ismail Mustafa
Member
 
Registered: Nov 2009
Location: Amman, Jordan
Distribution: Ubuntu 10.04, CentOS 5.5, FreeBSD 7.2, Debian Squeeze, PC-BSD 8
Posts: 44

Original Poster
Rep: Reputation: 0
Yay!

Many many thank yous! Shukran! Mucho Gracias! It works like a charm now

I'm surprised that that space was the cause of all of this!

Now to mark this as solved.

Last edited by Mustafa Ismail Mustafa; 01-22-2011 at 07:44 AM.
 
  


Reply

Tags
nfs


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
mount.nfs: mount to NFS server 'jesse' failed: timed out, retrying keupie Linux - Networking 3 06-05-2009 07:03 PM
Mount Ext3 Writeable for Specific Users Sigkill(9) Linux - Hardware 4 10-04-2006 09:07 AM
how to mount a nfs mount from linux client to AIX nfs server dennyqian AIX 8 09-22-2006 03:34 AM
making a vfat mount point writeable for users stevenhasty Linux - Newbie 27 03-31-2003 09:30 PM
HELP! Error from mount: drive is write-protected... won't mount writeable. system Linux - General 2 12-27-2001 09:08 PM


All times are GMT -5. The time now is 07:59 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration