unshare -m does not work as expected
marius at pov.lt
Fri Apr 26 12:06:39 UTC 2013
On Fri, Apr 26, 2013 at 02:50:01PM +0300, Kevin Wilson wrote:
> I am trying this simple sequence:
> unshare -m /bin/bash
> mount /dev/sd3 /mnt/sda3
> then from a different terminal I run:
> mount | grep sda2
> And I see this mount (which was not mounted before running this mount command)
> cat /proc/self/mountinfo | grep share (on the second terminal, and
> also on the first) does not find anything.
> So we don't have here a shared mount.
> Now, I would expect not to see sda3 mounted on the second terminal.
> I created a child with a different namespace in the first terminal.
> Why do I see it ?
Perhaps because /etc/mtab is a regular file that is shared by both of
You could replace /etc/mtab with a symlink to /proc/mounts, IIRC, but
there are some subtle caveats in some situations. I don't remember the
details, unfortunately. Google might help, perhaps.
* philiKON wonders what niemeyer is committing :)
*** benji_york is now known as benji
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 190 bytes
Desc: Digital signature
More information about the ubuntu-users