Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-21-2011, 03:03 AM
|
#1
|
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:
|
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 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)
|
|
|
|
01-21-2011, 05:13 AM
|
#2
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281
|
Can you post result of commands on the nfs server?
And on the client.
Last edited by eSelix; 01-21-2011 at 05:14 AM.
|
|
1 members found this post helpful.
|
01-21-2011, 05:18 AM
|
#3
|
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:
|
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)
|
|
|
|
01-21-2011, 06:45 AM
|
#4
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153
|
What is the output of ls -al /mnt ?
|
|
1 members found this post helpful.
|
01-21-2011, 07:32 AM
|
#5
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281
|
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.
|
01-21-2011, 03:07 PM
|
#6
|
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:
|
@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
|
|
|
01-21-2011, 04:25 PM
|
#7
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281
|
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.
|
01-21-2011, 04:29 PM
|
#8
|
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:
|
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.
|
|
|
01-21-2011, 05:36 PM
|
#9
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281
|
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 05:52 PM.
|
|
1 members found this post helpful.
|
01-22-2011, 02:35 AM
|
#10
|
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:
|
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
|
|
|
|
01-22-2011, 07:42 AM
|
#11
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281
|
Can you check "exportfs -v" on the server that there are really "rw" access?
|
|
1 members found this post helpful.
|
01-22-2011, 08:07 AM
|
#12
|
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:
|
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?
|
|
|
01-22-2011, 08:16 AM
|
#13
|
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281
|
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.
|
01-22-2011, 08:19 AM
|
#14
|
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:
|
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 08:44 AM.
|
|
|
All times are GMT -5. The time now is 05:13 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|