Read-only map
Hi List,
I have a problem:
My system (client, server) RHEL 5.2, latest updates.
1. NFS server is exporting read/write share
2. NIS automount map point to that share, but in read only like "key -ro nfsserver:/share/key"
Now, the "strange" thing is that on clients that share is mounted read only, fine, but when I go to the nfsserver itself, the share is mounted read write. I understand this is because mount --bind is used instead of nfs for performance reasons, but this way we lose the -ro flag. Is there any simple solution to this?
Thanks,
Ondrej
Quoted 8 lines · Ondrej Valousek
Hi List,
I have a problem:
My system (client, server) RHEL 5.2, latest updates.
1. NFS server is exporting read/write share
2. NIS automount map point to that share, but in read only like "key -ro nfsserver:/share/key"
Quoted 5 lines
Now, the "strange" thing is that on clients that share is mounted read only, fine, but when I go to the nfsserver itself, the share is mounted read write. I understand this is because mount --bind is used instead of nfs for performance reasons, but this way we lose the -ro flag. Is there any simple solution to this?
Well, you could add -fstype=nfs. In olden days, you could specify -nosymlink.
Cheers,
Jeff
We had the same problem. The kernel we were running had a "feature" where if the client mounts the same server and directory it would bind them together. You would get RO or RW depending on which directory was mounted first. You might be able to trick the client by making multiple addresses on the server and mounting one IP address for reads and one for writes or TCP and UDP?
I think that this "feature" was added because of machines running out of reserved ports. BTW, I have a patch for the reserved ports. Anyways, I guess you could verify that you are seeing the same behavior by doing something like:
Mount the same thing twice first time RO
# mkdir -p /mnt/test1 /mnt/test2 # mount -o ro lid40:/etc /mnt/test1 # mount -o rw lid40:/etc /mnt/test2
Both appear RO.
# touch /mnt/test1/passwd touch: cannot touch `/mnt/test1/passwd': Read-only file system # touch /mnt/test2/passwd touch: cannot touch `/mnt/test2/passwd': Read-only file system
Remount them again RW first and see that they both are RW.
# umount /mnt/test1 /mnt/test2 # mount -o rw lid40:/etc /mnt/test1 # mount -o ro lid40:/etc /mnt/test2 # touch /mnt/test1/passwd # touch /mnt/test2/passwd
This problem does not appear to be caused at all by autofs. It seems to be a problem/feature of the NFS client.
Steve
Quoted 23 lines · Ondrej Valousek
Hi List,
I have a problem:
My system (client, server) RHEL 5.2, latest updates.
1. NFS server is exporting read/write share
2. NIS automount map point to that share, but in read only like "key -ro nfsserver:/share/key"Now, the "strange" thing is that on clients that share is mounted read only, fine, but when I go to the nfsserver itself, the share is mounted read write. I understand this is because mount --bind is used instead of nfs for performance reasons, but this way we lose the -ro flag. Is there any simple solution to this?
Thanks,Ondrej
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs
Quoted 3 lines · Steve Linn
We had the same problem. The kernel we were running had a "feature" where if the client mounts the same server and directory it would bind them together. You would get RO or RW depending
The RHEL 5.2 kernel does not have that issue.
Cheers,
Jeff
I tried on RHEL 5.2 and it works, too.
But it still does not work with the automounter - still does the mount --bind (probably)....
Ondrej
Quoted 45 lines · Steve Linn
Interesting. I tried it on a Suse 9,3, Open Suse 10.3 kernel and an earlier RHEL and they failed. Opensuse 11 works though.
root@fid1 ~]$ mount -o ro lid40:/etc
/mnt/test1
[root@fid1 ~]$ mount -o rw lid40:/etc/mnt/test2[root@fid1 ~]$ touch/mnt/test2/passwd
touch: cannot touch `/mnt/test2/passwd': Read-only file system [root@fid1 ~]$ cat/proc/version
Linux version 2.6.9-34.0.1.EL.ADSKsmp (root@strasbourg) (gcc version 3.4.4 20050721 (Red Hat 3.4.4-2)) #1 SMP Tue Aug 12 21:24:17 EDT 2008 [root@fid1 ~]$ cat/etc/redhat-release
Red Hat Enterprise Linux WS release 4 (Nahant Update 3)suse11build /root# mount -o ro lid40:/etc
/mnt/test1suse11build /root# mount -o rw lid40:/etc/mnt/test2suse11build /root# touch/mnt/test2/passwd
suse11build /root# cat/proc/version
Linux version 2.6.25.9-0.2-pae (geeko@buildhost) (gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) ) #1 SMP 2008-06-28 00:00:07 +0200suse11build /root# cat
/etc/SuSE-release
openSUSE 11.0 (i586)
VERSION = 11.0Sorry about that,
SteveQuoted 14 lines · Jeff Moyer
Quoted 4 lines · Steve Linn
We had the same problem. The kernel we were running had a "feature" where if the client mounts the same server and directory it would bind them together. You would get RO or RW depending
The RHEL 5.2 kernel does not have that issue.
Cheers,
Jeff