Currently, /
has shared mount propagation:
# findmnt -o TARGET,PROPAGATION /
TARGET PROPAGATION
/ shared
I am considering changing it to private
to enable mount --move
to work on filesystems mounted under /mnt
and /media
.
(I want to use mount --move
rather than the unsafe umount --lazy
)
Without /
being private
, mount --move
will complain with something like:
# mount --move /mnt/mountpoint /mnt/moved
mount: /mnt/moved: bad option; moving a mount residing under a shared mount is unsupported.
Why is
/
shared
by default?What are the implications of changing
/
to beprivate
?
The propagation flag is changed by
systemd
. Fromman 7 mount_namespaces
:From https://github.com/systemd/systemd/blob/master/src/core/mount-setup.c#L406
The implications depend on your particular use cases. I think that most programs will continue to work. However, your change will be overwritten on reboot.
You can read more in the comment from Lennart Poettering in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739593
Here is a part of it: