How to add more /dev/loop* devices on Fedora 19? I do:
# uname -r 3.11.2-201.fc19.x86_64 # lsmod |grep loop # ls /dev/loop* /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop-control # modprobe loop max_loop=128 # ls /dev/loop* /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop-control
So nothing changes.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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.
Method 2
You have to create device nodes into /dev with mknod. The device nodes in dev have a type (block, character and so on), a major number and a minor number. You can find out the type and the major number by doing ls -l /dev/loop0:
<a href="https://getridbug.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e194928493a1878e8e">[email protected]</a>:/sys# ls -l /dev/loop0 brw-rw---- 1 root disk 7, 0 Oct 8 08:12 /dev/loop0
This means loop device nodes should have the block type and major number of 7. The minor numbers increment by one for each device node, starting from 0, so loop0 is simply 0 and loop7 is 7.
To create loop8 you run, as root, command mknod -m 0660 /dev/loop8 b 7 8. This will create the device node /dev/loop8 with permissions specified along the -m switch (that’s not necessary as you’re probably running a desktop system, but it’s a good idea not to let everyone read and write your device nodes).
Method 3
Heh, incomplete 🙂 Simply use this script for adding new /dev/loops. Remember for changing numbers, script makes to 63’th loop, starts from 8’th because 0-7 is made by default. Notice, rights are copied from /dev/loop0 🙂
for i in {8..63}; do if [ -e /dev/loop$i ]; then continue; fi;
mknod /dev/loop$i b 7 $i; chown --reference=/dev/loop0 /dev/loop$i;
chmod --reference=/dev/loop0 /dev/loop$i; done
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0