When using the 'mount' command with the -o ro and --bind options the command completes successfully, does not generate any errors or messages, and according to 'mount' the mount is a bind and is read-only. According to /proc/mounts the results are different, and as read-write. Despite 'mount' saying read-only, you can write to the mount. Reproducible: Always Steps to Reproduce: 1. mount -o ro --bind /foo /bar 2. mount (and check the entry, it says "(ro,bind)") 3. cat /proc/mounts 4. touch /bar/test 5. ls /bar/test Actual Results: The mount is read-write Expected Results: The mount should either: A) give a warning saying the mount is read-write (as is done in Ubuntu and Fedora) or; B) mount in true read-only
From mount(8): Note that the filesystem mount options will remain the same as those on the original mount point, and cannot be changed by passing the -o option along with --bind/--rbind.
(In reply to comment #1) > From mount(8): > > Note that the filesystem mount options will remain the same as > those on the original mount point, and cannot be changed by > passing the -o option along with --bind/--rbind. > I dont feel this is an invalid bug. According to the paragraph, the mount --bind should mount a read-write system as read-write. Why is it I am able to mount it read-only (according to 'mount') and write to it? Mount should not be saying that it is mounted as read-only when it isnt.
Hello Nicolas, i think Jeroen tried to say that this isn't a Gentoo specific bug. And mount behaves like specified in the manual, only the mount output is wrong. (in general, watch the difference between /etc/mtab and /proc/mounts, the first might be garbage on ro but is printed by mount afaik) Please consider filing a bug upstream, the ebuilds lists http://www.kernel.org/pub/linux/utils/util-linux-ng/ as a homepage, http://www.kernel.org/pub/linux/utils/util-linux-ng/README lists http://userweb.kernel.org/~kzak/util-linux-ng/ , (which is a bug in the ebuild). they have a mailinglist+archive for bug tracking. Michael