so this interates mountinfo; finds /run/mnt/data mountpoint; finds it major:minor; finds it's dm name; checks the slaves of said dm; to find underlying device; to find the parent of that device; to find major:minor of it; and map it back to it's name.
Doing this should reliably map "mountpoint -> parent device name" based on kernel information.
$ basename $(readlink /dev/block/$(cat /sys/block/ $(basename $(readlink /dev/block/`grep /run/mnt/data /proc/self/ mountinfo | tail -n1 | cut -d\ -f3`))/ slaves/ */../dev) )
sda
so this interates mountinfo; finds /run/mnt/data mountpoint; finds it major:minor; finds it's dm name; checks the slaves of said dm; to find underlying device; to find the parent of that device; to find major:minor of it; and map it back to it's name.
Doing this should reliably map "mountpoint -> parent device name" based on kernel information.