Mounting new filesystem affects non-recursive bind mounts?
You should be able to see that new mounts stop being copied, if you run mount --make-private
on the mount point.
The difference when running bash as init, is that the source filesystem has been mounted as private.[*] Whereas booting the full system is effectively running --make-shared
. You can see the difference by looking at findmnt -o +PROPAGATION
.
Once the root filesystem is mounted as shared, any filesystem mounted directly under it will inherit the same propagation setting.
The root filesystem is being remounted as shared by systemd
. This feature was added to systemd around 2012. It was discussed on the amazing Arch Linux wiki.
https://wiki.archlinux.org/index.php?title=Talk:Systemd&oldid=411350#Systemd_defaults_.2F_to_rshared.2C_gotcha
https://github.com/systemd/systemd/commit/b3ac5f8cb98757416d8660023d6564a7c411f0a0
While you're reading this, I also recommend learning how to safely disassemble a recursive bind mount. Because on shared mounts, mounts and unmounts propagate in both directions :-).
[*] Booting with init=/bin/bash
, I saw the filesystems mounted as private. Even though I was still booting with Fedora's dracut
initramfs, which runs systemd internally. I'm not 100% sure what was happening here.