in an attempt to access a truecrypt container, I stumbled about the prerequisite of setting up a loop device...

ncoghlan suggested in an earlier answer

When you run it as root, losetup -f will automatically create loop devices as needed if there aren't any free ones available. So rather than doing it yourself with mknod, the easiest way to create a new loop device is with sudo losetup -f. That approach will give you a free existing loop device if one exists, or automatically create a new one if needed.

My result of "sudo losetup –f" is

losetup: –f: failed to use device: No such file or directory

Searching for this message+losetup so far does not help.

Result of "lsmod |grep loop" is

loop                   28672  0

uname -r

  • 1
    sudo losetup -f requires an argument - a file to be set up as a backing storage for the loop device (the file containing your virtual disk/fs image)
    – Serge
    Jun 25 '16 at 13:10

Serge's comment made me do my homework - study the man page in more depth than before. The solution was simply to enter in the shell


(without any arguments). Then, afterwards,

losetup -f

resulted, successfully, in


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.