Table of Contents
http://www.slax.org/documentation_loop_mount.php
Since Slax 6 is using Linux Kernel 2.6.24 and newer, the limit is not there anymore and you can use as much loop devices as you need. On the other hand, there was a need to retain backward compatibility with all the broken tools (like modprobe, losetup, etc.), which still refuse to work on a loop devices with minor number bigger than 255. So the following approach has been negotiated:
If a max_loop=n boot parameter is specified, it behaves like before, the 'n' becomes a new limit and udev creates 'n' files in /dev/loop/. If the parameter is not specified (it is not in Slax), a loop device per module is created (with a minimum of 8) and you have to mknod more manually, if you need them.
Error message "couldn't find any free loop device"
If you see this error after an attempt to mount -o loop, simply see /dev/loop/* and create a next loop device number using
mknod /dev/loop/100 b 7 100
If you reach the limit of 256, you'll need to loop-mount in two steps:
# first create a new loop device mknod /dev/loop/300 b 7 300
# then assign your loop file to new loop device losetup /dev/loop/300 your_loop_file.dat
# and finally mount the loop device insetad of the file mount /dev/loop/300 /your_mount_directory/
# if you then need to unmount, use umount /your_mount_directory/ losetup -d /dev/loop/300
If you wish to create a new loop device automatically in your script, include /usr/lib/liblinuxlive in it and call mknod_next_loop_dev function:
NEW_LOOP=$(mknod_next_loop_dev) losetup $NEW_LOOP your_file mount $NEW_LOOP /your/mount/directory
Tomas M
documented on: 2008-03-30