Yes, the directory is there, because you mounted it there. mount --bind
tells the kernel to use an existing mount and attach it to another mount point. As far as the kernel is concerned,
mount /dev/something /path/share
mount --bind /path/share /path/home/user/stuff
and
mount /dev/something /path/home/user/stuff
mount --bind /path/share /path/home/user/stuff
are the same thing. There are two ways to distinguish them:
- If
/path/share
is not a mount point (i.e. it's part of a larger filesystem mounted at /path
or /
), you can tell the bind mount because it's not at the root of the filesystem.
- The
mount
program records its actions in /etc/mtab
.
The df
command reads /etc/mtab
, so if a directory is on a filesystem that's been mounted with the bind
option, you can see what the original path was with
df -P /path/to/file | awk 'NR==2 {print $1}'
(first field of the second line). Note that this information isn't always reliable, for example it's possible that the original filesystem has been unmounted and nothing, or something else, is now mounted at this location, as in
mount /dev/something /path/share
mount --bind /path/share /path/home/user/stuff
unmount /dev/something
mount /dev/somethingelse /path/share