loopback device mount losetup -fP myfile option -f : find first avail loop device option -P : auto scan for parts show all loop devices losetup -a search for a loop dev attached to a file losetup --list | grep fullpath-of-loopfile | awk '{print $1}' detach loop device losetup -d /dev/loopXX