Mount: could not find any free loop device

isoloop-devicemount

When I try to mount an ISO image with mount -o loop I get

mount: could not find any free loop device

Running losetup -a shows

/dev/loop0: [0005]:2464 (/dev/sda1)
/dev/loop1: [0005]:3439 (/dev/loop0)
/dev/loop2: [0005]:4482 (/dev/loop1)
/dev/loop3: [0005]:4486 (/dev/loop2)
/dev/loop4: [0005]:4490 (/dev/loop3)
/dev/loop5: [0005]:4494 (/dev/loop4)
/dev/loop6: [0005]:4498 (/dev/loop5)
/dev/loop7: [0005]:4502 (/dev/loop6)

What is the purpose of a loop device which refers to sda1? And what is the purpose of all the other loop devices referring to the previous one?

Is it safe for me to disconnect these loop devices so that I can use them? If so how do I do so? (Running losetup -d /dev/loop[0-7] gives loop device is busy.) If I cannot disconnect these, how do I create new loop devices that I can use for mounting ISO images?

p.s. I am running Debian "wheezy" v 7.1.0.

Best Answer

Take a look and see if there are any mounts using any of the above loopback devices. You can use the mount command to see this:

$ mount

If they are mounted, they you'll likely need to unmount (umount) them prior to getting losetup -d <loopdevice> to detaching them.

$ umount /dev/some/mount

As to if it's safe or not, that really depends on what these are being used for. I'd probably hold off till I had a better grasp of what these loop devices are for, before I started unmounting them. Just a guess but they might have something to do with an encrypted drive.

Therefore I'd create another one just to be safe.

making another loop device

Here are the steps:

$ sudo mknod -m640 /dev/loop8 b 7 8
  • -m640 define the permission of the device
  • /dev/loop8 define the name of the device
  • b for the creation of the special block device
  • 7 8 the number 7 AND 8 define the MAJOR AND the MINOR

Check if the loop is created:

$ ls -l /dev/loop8
brw-r----- 1 root root 7, 8 Oct 3 14:54 /dev/loop8

Now set ownership on the device:

$ sudo chown root:disk /dev/loop8

References

Related Question