loop device

Joey Korkames joey at kidfixit.com
Fri Sep 11 03:49:07 UTC 2009

Scott James Remnant writes:

> On Mon, 2009-09-07 at 05:57 -0400, Pete Graner wrote:
>> Eugene Gorodinsky wrote:
>> > Sorry, I meant nobody had stated the reasons for compiling the loop
>> > device into the kernel. Or was that the reason to compile it in rather
>> > than the reason to not compile it in?
>> It was done primarily as an effort to link in all common modules across 
>> all kernels. It was perhaps an oversight since increasing loop devs is a 
>> real need.
> Untrue.
> It's compiled in because we have no method for on-demand loading of this
> module.  If you don't compile it in, loop devices will fail to mount
> unless you run "modprobe loop" somewhere.
> I don't see any reason why this module cannot expose its configuration
> parameter in /sys to be adjustable at run time.  Better still, source
> the LKML patches to make loop devices simply dynamic (so we don't always
> have a fixed number).

Apparently you can mknod any amount of /dev/loop[0-255] 7:[0-255] devices 
_until_ max-loop is (re)set:

Then, if I read right, open()ing any of them will trigger a kmod-enabled 
kernel to run modprobe (tuneable: /proc/sys/kernel/modprobe) via keventd. 
Having "alias block-major-7 loop" somewhere under /etc/modprobe.d/ should 
get loop loaded (an entry not on my Debian Etch box - I don't have a 'buntu 

The default 8 loop nodes (under /dev/.static/dev) is just a /sbin/MAKEDEV trick.

Either way, you'll either be modprobing loop or mknod'ding "manually".
On any system where I know loop mounts will be needed, I add 
loop to /etc/modules or rc.local depending on the distro.


More information about the kernel-team mailing list