A lot of people keep saying that Linux does not keep information about bind mounts, so there is no way to get a list of them and their sources. Here are some examples:
IIRC this information is not kept anywhere: after
mount --bind, the two copies are equivalent, there isn't one that's more “original” than the other. After all there could be no original if you'd already unmounted
from an answer on this site:
So the only way to remember what mounts were bind mounts is the log of mount commands left in
/etc/mtab. A bind mount operation is indicated by the bind mount option (which causes the filesystem type to be ignored). But mount has no option to list only filesystems mounted with a particular set of sets of options.
from a Debian bug report:
This is intentional. Both mount points are fully equal in all ways so the kernel does not keep any flags to differentiate them.
The above is nonsense though. The tool
findmnt is able to list the source paths of bind mounts (in the form of
device[source-path]; I'm also trying to get it to list just the source path and not the device). If the Linux kernel is to maintain a bind mount, then that information has to be stored somewhere, otherwise it couldn't know that
/home is bound to
/users. So where is this data? Is it stored in some obscure region in RAM? Does
findmnt look in