[DRBD-user] BUG ALERT! 8.3.1 + RHEL 4 / CentOS 4 + [udev problem with DRBD]

Lars Ellenberg lars.ellenberg at linbit.com
Thu May 28 17:18:49 CEST 2009

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.

drbd 8.3.1 + RHEL4 udev breaks all device nodes.
details below.

On Fri, May 22, 2009 at 09:40:05AM -0400, Ken Dechick wrote:
> > ?? Yes once I remove the udev rule for drbd the whole "wierd" links 
> > things goes away, and all my devices work as expected again. So 
> > without relying on udev what were most people doing to create the 
> > /dev/drbd0 at boot? Can I do something as simple as adding a mknod 
> > command in /etc/rc.d/rc.local? I have one last question: upon a reboot 
> > my primary node does not come up as primary, I have to issue an 
> > 'drbdadm primary r0' to get it to come up. Is this normal?
> >> We've did some tests under 4.7 and could not reproduce what you are 
> >> seeing (well, and 4.8 is just around the corner).
> I wonder if this is perhaps a kernel issue?

No. Actually it is a udev issue,
and it is broken on 4.7 and 4.8 as well.

# This file contains the rules to create named DRBD devices.

KERNEL=="drbd*", \
	IMPORT{program}="/sbin/drbdadm sh-udev minor-%m", \
	NAME="$env{DEVICE}", \
	SYMLINK="drbd/by-res/$env{RESOURCE} drbd/by-disk/$env{DISK}"

the rhel4 udev does not understand ==,
and does not understand IMPORT{program}.
therefore $env{} is not expanded either.

fortunately it ignores rule definitions it does not understand.
unfortuately it only ignores the "physical" line
the parse error occurs in.

_including_ the trailing line-continuation marking backslash.

so the rule it actually parses turns out to be
	NAME="$env{DEVICE}", \
	SYMLINK="drbd/by-res/$env{RESOURCE} drbd/by-disk/$env{DISK}"

guess what.
it is in no way restricted.

any preceeding rule is overridden!

every device created by udev will be created as literal /dev/$env{DEVICE}
regardless of type or class.

only udev rules with higher priority will again override this.

one of the devices affected is the network loopback device,
so if you reboot with this udev rule file in place,
you will break all daemons and ipc that wants to utilize

(in that situation, do a ifconfig -a and enjoy.
 or, with that udev file installed on rhel4,
 do "udevtest /sys/tty/ttyS0". doh.)

it may do even real damage in case you have something that writes to
a /dev/whatever symlink, that now suddenly points to something
completely unexpected.

</insert favorite curse words here>

workaround: remove the drbd udev file, as RHEL4 udev does not even
understand it anyways.

8.3.2 will ship the rule as one long line,
just in case,
and add some sort of white-list-only install of this file
for system where it is *positively known to work*.


: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
please don't Cc me, but send to list   --   I'm subscribed

More information about the drbd-user mailing list