Get Mount target from path

Valdis.Kletnieks at Valdis.Kletnieks at
Thu Feb 5 15:47:27 EST 2015

On Wed, 04 Feb 2015 16:23:26 +0900, manty kuma said:

> I would like to know the mount target for a given directory. In kernel, is
> there an API to get the information?

Explain what problem you're trying to solve.  Your example:
/system/bin is a directory its mount partition is /system.
isn't very clear on what you mean.  Do you mean "I did a
mount /dev/foox4 /mnt/wombats and now I want to find /dev/foox4",
or did you mean "given a pathname or inode, what filesystem is
it on?"

(Bonus points for explaining what your solution should do with bind mounts
and overlayfs and other exotic stuff like that)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : 

More information about the Kernelnewbies mailing list