unshare -m does not work as expected
Kevin Wilson
wkevils at gmail.com
Fri Apr 26 16:40:06 UTC 2013
Hello,
Indeed these were two typos as I was not running copy&paste.
Here is exact details with copy&paste and with more info:
session 1, terminal #1
mount | grep sda3
gives nothing.
unshare -m /bin/bash
mount /dev/sda3 /mnt/sda3
mount | grep sda3
shows
/dev/sda3 on /mnt/sda3 type ext3 (rw)
readlink /proc/self/ns/mnt
mnt:[4026532114]
session 2, terminal #2
In the beginning,
mount | grep sda3
gives nothing.
after the mount done on the other terminal (#1, session 1)
mount | grep sda3
/dev/sda3 on /mnt/sda3 type ext3 (rw)
readlink /proc/self/ns/mnt
mnt:[4026531840]
so this is a different namespace then session 1.
Moreover:
According to this post, the result should have been different.
And AFAIK, event this post is from 2009, this did not change and
still should be so.
rgs,
Kevin
On Fri, Apr 26, 2013 at 7:01 PM, Colin Law <clanlaw at googlemail.com> wrote:
> On 26 April 2013 12:50, Kevin Wilson <wkevils at gmail.com> wrote:
>> I am trying this simple sequence:
>>
>> unshare -m /bin/bash
>> mount /dev/sd3 /mnt/sda3
>
> Is there a typo there?
>
>>
>> then from a different terminal I run:
>> mount | grep sda2
>
> Is there another typo there?
>
> It might be best to run the commands and copy/paste the results here.
> Run the mount | grep before the unshare just to confirm and post the
> complete sequence.
>
> Colin
>
>>
>> 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 ?
>>
>>
>> regards,
>> Kevin
>>
>> --
>> ubuntu-users mailing list
>> ubuntu-users at lists.ubuntu.com
>> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
More information about the ubuntu-users
mailing list