Question:
if I loopmount a file, like this
mount /volumes/jfs.dsk /mnt/jfs -t jfs -o loop
then what happens behind the scenes is
losetup /dev/loop1 /volumes/jfs.dsk
mount /dev/loop1 /mnt/jfs -t jfs -o loop
My question now:
If I have /dev/loop1, how can I find which file this device belongs to ?
e.g. given "/dev/loop1" as input, how can I get back /volumes/jfs.dsk ?
Since nobody knew the concrete answer, I answer it here as reference for others:
And this is the C version: