No network in chroot environment
Tom H
tomh0665 at gmail.com
Sun Jan 26 13:28:01 UTC 2020
On Sat, Jan 25, 2020 at 7:00 PM Volker Wysk <post at volker-wysk.de> wrote:
> Am Samstag, den 25.01.2020, 13:17 +0100 schrieb Volker Wysk:
>> !?!ยง% I've lost the mail which I habe been writing. Stupid Evolution.
>> Am Freitag, den 24.01.2020, 23:57 +0100 schrieb Tom H:
>>>
>>> If you bind-mount "/a" onto "/b".
>>>
>>> If "/b" is marked as shared, changes under "/a" propagete to "/b"
>>> and
>>> changes under "/b" propagate to "/a".
>>>
>>> If "/b" is marked as a slave, changes under "/a" propagete to "/b"
>>> and
>>> changes under "/b" don't propagate to "/a".
>>>
>>> There's also "private" and "unbindable".
>>
>> Great! That's exactly what is needed. I'll do:
>>
>> mount --rbind /run $mountpoint/run
>> mound --rslave $mountpoint/run
> ^^^^^^^^ typo. Should be "--make-rslave"
>> (...)
>> chroot $mountpoint
>
> This doesn't work.
>
> Without doing "mount --make-rslave ...", changes to /mnt/rootneu/run
> are propagated to /run, as expected. (The new root file system is
> mounted at /mnt/rootneu):
>
> # mount --rbind /run /mnt/rootneu/run
> # touch /mnt/rootneu/run/xyz
> # ls /run/xyz /mnt/rootneu/run/xyz
> /mnt/rootneu/run/xyz /run/xyz
> # rm /run/xyz
>
> But after doing "mount --make-rslave ...", changes in /mnt/rootneu/run
> STILL are propagated to /run:
>
> # mount --make-rslave /mnt/rootneu/run
> # touch /mnt/rootneu/run/xyz
> # ls /run/xyz /mnt/rootneu/run/xyz
> /mnt/rootneu/run/xyz /run/xyz
>
> Have I done something wrong, in the above example?
Yes, because I misled you. _SORRY_!
It's further sub-mounts not anything else that aren't propagated.
More information about the ubuntu-users
mailing list