I use a lot of loop filesystems (/dev/loopN) with embedded devices, and something that's always bothered me is this: once a loop file has been mounted with a loop device, how do I get the name of the original file?
I tried this:
... but on my system, it outputs a truncated path:
Code:
/dev/loop0: [0802]:19358161 (/home/lex/Projects/Backup/media/card/*)
I don't know what the '*' is doing there.
I found the answer when looking in /sys:
Code:
cat /sys/devices/virtual/block/loop0/loop/backing_file
/home/lex/Projects/Backup/media/card/loop-images/home.ext2
Sorted!