When trying to read-only remount a NFS volume with 'mount -u -r /mnt' the volume will be/remain mounted read-write. Neither the mount command nor the logfiles show any diagnostics, mount's exitcode is 0. Note: This problem is strongly related to PR 136470 kern/136470: [nfs] Cannot mount / in read-only, over NFS PR Summary: A network booted machine has root NFS mounted read-write, although in rc.conf root_rw_mount="NO" is set. Because I run diskless setups, I stumbled over the same problem and found the PR above. My further investigations of such a network boot environment show, that rc.d/root respects the config var set, but later rc.d/mountcritremote calls "mount -a -t nfs", which will silently remount / as read-write. I marked this PR as serious because with the current behaviour of mount one can accidently read-write mount a volume. Fix: Only workarounds: - make the exported filesystem read-only - export the NFS volume as read-only - umount and NFS remount read-only How-To-Repeat: Setup an NFS server (here: FreeBSD 4.9 running a NFS server with defaults), then goto 7.2 nfs client machine and do: # mount server:/fs /mnt # mount server:/fs on /mnt (nfs) # mount -u -r /mnt # mount server:/fs on /mnt (nfs) # umount /mnt # mount -r server:/fs /mnt # mount server:/fs on /mnt (nfs, read-only) # mount -u -r /mnt # mount server:/fs on /mnt (nfs)
Responsible Changed From-To: freebsd-bugs->freebsd-fs Over to maintainer(s).
On 2009-10-15, Alexander Haderer wrote: > Setup an NFS server (here: FreeBSD 4.9 running a NFS server with defaults), then goto 7.2 nfs client machine and do: > > # mount server:/fs /mnt > # mount > server:/fs on /mnt (nfs) > # mount -u -r /mnt > # mount > server:/fs on /mnt (nfs) I couldn't reproduce this on 8.1: # mount server:/stor /mnt # mount . . . server:/stor on /mnt (nfs) # mount -u -r /mnt # mount . . . server:/stor on /mnt (nfs, read-only) # touch /mnt/foo touch: /mnt/foo: Read-only file system -- Jaakko
Am 04.01.2011 17:57, schrieb Jaakko Heinonen: > On 2009-10-15, Alexander Haderer wrote: >> Setup an NFS server (here: FreeBSD 4.9 running a NFS server with defaults), then goto 7.2 nfs client machine and do: >> >> ... > > I couldn't reproduce this on 8.1: > I couldn't reproduce this too, on 8.0 and 8.1 i386. seems to be fixed in 8 branch. Alexander
State Changed From-To: open->patched Fixed in stable/8 according to submitter.
This was fixed long ago. Re-confirmed that it still works properly on 12-current.