[systemd-devel] udevd creates unwanted loop devices, and too early

Jan Engelhardt jengelh at inai.de
Fri Oct 12 14:50:29 PDT 2012


Hi,

on openSUSE 12.2, which has udev-182 and systemd-44, I found that 
starting udevd creates some loop devices in /dev (which is a devtmpfs).

* boot linux using "-b" to make systemd go into emergency
# ls /dev/loop*
ls: cannot access /dev/loop*: No such file or directory
# systemctl start udev.service
# ls /dev/loop*
/dev/loop0  /dev/loop2  /dev/loop4  /dev/loop6  /dev/loop-control
/dev/loop1  /dev/loop3  /dev/loop5  /dev/loop7

These are created as block-major(8,0) through (8,7), 
respectively [and c(10,237) for loop-control].

Now, in /etc/modprobe.d/99-local.conf, I have set forth:

  options loop max_loop=256 max_part=15

So that when loop.ko is actually loaded, it creates

  /dev/loop0  b(8,0)
  /dev/loop1  b(8,16)
  ...
  /dev/loop7  b(8,112)
  /dev/loop8  b(8,128)
  ...

However, because udevd already created loop devices for whatever reason, 
when loop.ko is loaded, the preexisting loop devices are not touched. 
This leads to

  /dev/loop0  b(8,0)
  /dev/loop1  b(8,1)
  ...
  /dev/loop7  b(8,7)
  /dev/loop8  b(8,128)
  ...

and tools like losetup fail to do their job because /dev/loop1 
references an invalid device.


More information about the systemd-devel mailing list