A mount point
/mnt/sub is shadowed by another mount point
/mnt. Is it always possible to access the mounted filesystem?
Root access is a given. The system is a reasonably recent Linux.
Example scenario: accessing the branches of an overlay root
The basic sequence of operations is:
mount device1 /mnt/sub mount device2 /mnt
/mnt/sub is a file on
device2 (if it exists). The question is how to access files on
Some devices can be mounted twice, so
mount device1 /elsewhere would work. But this doesn't work for all devices, in particular not for FUSE filesystems.
This differs from the already covered case where a subdirectory is shadowed by a mount point, but the mount point of the subdirectory is itself visible, and a bind mount can create an unobscured view. In the example above,
mount --bind / /elsewhere lets us see the
/mnt/sub directory from the root filesystem on
/elsewhere/mnt/sub, but this question is about accessing the filesystem on