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

by

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 :

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

By:

        loop)
                for part in `seq 0 63`
                do
                        makedev loop$part b 7 $part $disk
                done
                ;;

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
done
Comments are closed.
700585101d64536c6a47ca45d3e2bbb7VVVVV