More loop devices

More loop devices

I have this very special server at work : a sunfire x4200 8 core 8GB RAM
To use the full given power, I tried to install xen on ubuntu, but it were freezing all the time. It seems to be a “TAP” problem, but I couldn’t fix it.
So I tried a Debian 5.0.3 dom0, and the problem is slightly different : now the domU won’t find its drives if I use “tap:aio”.
Ok, go back to the old “file:” driver.
This one is using loop devices to enable the drives, and only 8 default loop devices are enabled on debian (/dev/loop0 to /dev/loop7). As I want 7 domU, and at least 2 drives for each one (root and swap), I need more than 8 of these.
Here’s how to add more loop devices :

On Debian and ubuntu loop is a module, and you can specify the number of loop devices you want in /etc/modules. Replace :



loop max_loop=64

(64 for example)

Then you have to disable the module :

rmmod loop

and re-enable it :

modprobe loop

But the new devices won’t append automatically for sure, so if you don’t see them in /dev/loop*, you can make them appear this way :
Edit /sbin/MAKEDEV and change :

                for part in 0 1 2 3 4 5 6 7
                        makedev loop$part b 7 $part $disk


                for part in `seq 0 63`
                        makedev loop$part b 7 $part $disk

And execute

$ MAKEDEV loop

For me this step didn’t work either, so I had to create it really by hand :

for i in $(seq 0 63); do
    mknod -m0660 /dev/loop$i b 7 $i
    chown root.disk /dev/loop$i

2 thoughts on “More loop devices

  1. Instead of editing /sbin/MAKEDEV I added lines 23-27 to /etc/init/mounted-dev.conf:

    13 script
    14 # With the /run transition, shm lives there now, but eglibc still looks in
    15 # /dev/shm. So create a symlink there
    16 [ -e /dev/shm ] || ln -s /run/shm /dev/shm
    18 if [ “${TYPE}” != “devtmpfs” ]
    19 then
    20 cd “${MOUNTPOINT}”
    21 /sbin/MAKEDEV std console fd ppp tun loop_32
    22 fi
    23 cd “${MOUNTPOINT}”
    24 for i in `seq 8 31`
    25 do
    26 /sbin/MAKEDEV loop$i
    27 done
    28 end script

  2. hi i try to mount and it fail.. :S
    for example mount /dev/loop21 /datos/directory and i get that the divice is in use and this is iqual for the others loops divices and acording to syslog utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive! what it can be ? you get this problem ? i need help i wait for your answer Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *