I have an encrypted container containing an ext4 filesystem with a subdirectory which is bind-mounted at a later point in time. If I take look at /proc/self/mountinfo, the root-directory for the mount has a value I do not know the reason for.
Steps to reproduce:
cd /tmp fallocate -l 1G container.luks cryptsetup luksFormat container.luks cryptsetup open --type=luks2 container.luks container mkfs.ext4 /dev/mapper/container mkdir /mnt/container mount /dev/mapper/container /mnt/container/ mkdir /mnt/container/subdir mkdir /tmp/abc mount -o bind /mnt/container/subdir/ /tmp/abc cat /proc/self/mountinfo ... 24 1 253:1 / / rw,noatime - ext4 /dev/dm-1 rw ... 56 24 253:5 / /mnt/container rw,relatime - ext4 /dev/mapper/container rw 57 24 253:5 /subdir /tmp/abc rw,relatime - ext4 /dev/mapper/container rw As per man 5 proc field #4 is
root: the pathname of the directory in the filesystem which forms the root of this mount.
Why is field #4 of the last line /subdir and not /mnt/container/subdir? Given the information for mount #57, how I am able to deduce, that mount #57 is a bind mount of a subdirectory of mount #56?
Sidenote: umount -R /mnt/container ignores mount #57.
Given the answer from Uncle Billy and several rereads of the relevant man-pages, my explanation is that /subdir is viewed from the root of a potential non-existent mount-point of device 253:5 somewhere in the system. I hope that makes some sense.