Grub change loopback amount?

I’m having an issue with loopback. It looks like there is only 8. I did a search and apparently the problem is grub by default only has 8 loopback (devices?). If i look in /dev/ i see loop 0-7 so that does seem to make sense.

How do i change the amount of loopbacks?

Asked By: user4069

||

I’m not sure how GRUB comes into this, as you don’t explain the connection, but you can increase the number of simultaneously usable loop devices using the loop module (without a reboot).

modprobe loop max_loop=64

You can then manually make more loop devices with mknod like so:

mknod -m 660 /dev/loop8 b 7 8

Make sure the new loop device is owned by root:disk for consistency:

chown root:disk /dev/loop8

In the mknod command:

  • The major number for loop devices is 7. That’s what the 7 represents (constant for all loop devices)
  • The minor number is unique for each loop device. It starts from 0 for /dev/loop0, 1 for /dev/loop1, and so on.

The 8 represents the minor number for /dev/loop8.
So, for /dev/loop9, you would increase the minor number by one:

mknod -m 660 /dev/loop9 b 7 9

Here’s a shell command to create a large number of them at one time (starting with 10 through 254):

for i in {10..254}; do
    mknod -m 660 /dev/loop$i b 7 $i
    chown root:disk /dev/loop$i
done
Answered By: Chris Down
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.