Skip to contentSkip to conversation

Problem with udev and dmcrpyt

dm-crypt Aaron Lewis 3 participants 10 messages Jul 16, 2010

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi
I'm setting up dmcrypt , but i've got those kernel messages:

udevd-work[7416]: kernel-provided name 'dm-2' and NAME= 'mapper/crypt_0' disagree, please use SYMLINK+= or change the kernel to provide the proper name

So i put udev rules like this:

	KERNEL=="dm-0",NAME="dm-0",SYMLINK+="mapper/home"
	KERNEL=="dm-1",NAME="dm-1",SYMLINK+="mapper/code"

But another warning came out:

udevd-work[5650]: device node '/dev/dm-0' already exists, link to
'/dev/dm-0' will not overwrite it

How can i get rid of that together ?

Many thanks.

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkw/x5UACgkQvf41sEptMqASdgCgn1j+0kCSOPidfS+GdFFJUQhS sqkAoKtSC8zrP9bM+EmwSQJMNS4B8Gdj
=p9Wv
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 9 lines · Aaron Lewis

udevd-work[7416]: kernel-provided name 'dm-2' and NAME= 'mapper/crypt_0' disagree, please use SYMLINK+= or change the kernel to provide the proper name

So i put udev rules like this:

	KERNEL=="dm-0",NAME="dm-0",SYMLINK+="mapper/home"
	KERNEL=="dm-1",NAME="dm-1",SYMLINK+="mapper/code"

This is completely wrong, never do that. dm-X names are dynamic. No need to worry about the warning above if it works.

Quoted 1 line

How can i get rid of that together ?

Update package which provides DM new rules. Yor distro should provide it if they update udev.

Milan

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Milan.

On 07/16/2010 03:42 PM, Milan Broz wrote::

Quoted 6 lines
Quoted 3 lines
	KERNEL=="dm-0",NAME="dm-0",SYMLINK+="mapper/home"
	KERNEL=="dm-1",NAME="dm-1",SYMLINK+="mapper/code"

This is completely wrong, never do that. dm-X names are dynamic. No need to worry about the warning above if it works.

device name is dynamiclly allocated , i think so.
Shouldn't there be some ways to identify it like UUID ? In that case , i'll be able to put more accurate rules.

Quoted 5 lines
Quoted 2 lines

How can i get rid of that together ?

Update package which provides DM new rules. Yor distro should provide it if they update udev.

Guess gentoo never provide such services.

Quoted 2 lines

Milan

every time when i'm booting , after putting my credentials , those messages appear , it's harmless..Hmm , i just want to keep it somewhat `clean'.

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxAOioACgkQvf41sEptMqCOFwCgpYEV3FKBoO9qM+6PtQFHoih0 4boAnRXIklS9LRVrKdNGVW99kLDOSqZr
=7RiK
-----END PGP SIGNATURE-----

#3 lore raw

Am 16.07.2010 12:53, schrieb Aaron Lewis:

Quoted 3 lines

device name is dynamiclly allocated , i think so.
Shouldn't there be some ways to identify it like UUID ? In that case , i'll be able to put more accurate rules.

The "name" is whatever you call it when you run cryptsetup luksOpen (or create). The file system inside the volume can be identified by UUID as any file system can.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

How can i get rid of that together ?

Update package which provides DM new rules. Yor distro should provide it if they update udev.

Guess gentoo never provide such services.

They should. Upstream device mapper provides udev rules that should be installed with device-mapper. If no udev rules are installed, I would consider that a bug.

#4 lore raw
Quoted 8 lines · Thomas Bächler

Am 16.07.2010 12:53, schrieb Aaron Lewis:

Quoted 3 lines

device name is dynamiclly allocated , i think so.
Shouldn't there be some ways to identify it like UUID ? In that case , i'll be able to put more accurate rules.

The "name" is whatever you call it when you run cryptsetup luksOpen (or create). The file system inside the volume can be identified by UUID as any file system can.

For example ? With udev rules or dmcrypt configurations ?

Quoted 12 lines
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

How can i get rid of that together ?

Update package which provides DM new rules. Yor distro should provide it if they update udev.

Guess gentoo never provide such services.

They should. Upstream device mapper provides udev rules that should be installed with device-mapper. If no udev rules are installed, I would consider that a bug.

Signature · 4 lines
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
#9 lore raw
In reply to Aaron Lewis
Quoted 4 lines · Aaron Lewis
Quoted 2 lines

Update package which provides DM new rules. Yor distro should provide it if they update udev.

Guess gentoo never provide such services.

It does, I am using it there:-)
maybe it is masked - that's bug, lvm must depend on new rules/udev then.

Long answer for the archive:

Formerly LVM/DM/cryptsetup managed dev nodes itself.

Later it started to utilize udev for this job, but the transition process was very painfull and had many iterations. DM used some extension to block device concept which were incompatible with udev view and vice versa.

So there were several versions of udev rules using various udev extensions, some of these extension were removed from udev in later releases (changing base device name is one of them).
It probably takes some time until all changes are propagated to distros...

Bu we finally iterated to situation that udev rules are now working properly
- with compromises on both sides.
(Only one problems remains - namely "watch" rule but is is not related to this problem).

Still, there is fallback mechanism in libdevampper - if the required device node is not created by udev, it fallback to manual node creation.
(So even in misconfigured system it should work.)

The above means, that distro maintainers should start to compile lvm with udev support, provide most recent udev rules (part of upstream lvm2/dm package) and require new udev package which includes all require functionality.

Milan

#5 lore raw
In reply to Aaron Lewis
Quoted 5 lines · Aaron Lewis
Quoted 3 lines

The "name" is whatever you call it when you run cryptsetup luksOpen (or create). The file system inside the volume can be identified by UUID as any file system can.

For example ? With udev rules or dmcrypt configurations ?

See ehat dm udev rules is doing - using DM_NAME attribute to create symlinks etc. There is nothing special needed for dm-crypt - DM rules are common.

ls /lib/udev/rules.d/*-dm-*
/lib/udev/rules.d/11-dm-lvm.rules
/lib/udev/rules.d/13-dm-disk.rules
/lib/udev/rules.d/95-dm-notify.rules

(on my Gentoo test system)

No need to hack udev rules yourself and reinvent the wheel.

Milan

#6 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 8 lines · Milan Broz
Quoted 5 lines · Aaron Lewis
Quoted 3 lines

The "name" is whatever you call it when you run cryptsetup luksOpen (or create). The file system inside the volume can be identified by UUID as any file system can.

For example ? With udev rules or dmcrypt configurations ?

Quoted 7 lines

See ehat dm udev rules is doing - using DM_NAME attribute to create symlinks etc. There is nothing special needed for dm-crypt - DM rules are common.

ls /lib/udev/rules.d/*-dm-*
/lib/udev/rules.d/11-dm-lvm.rules
/lib/udev/rules.d/13-dm-disk.rules
/lib/udev/rules.d/95-dm-notify.rules

Yep , so udev reads two directory as configurations ?
+ /etc/udev/rules.d
+ /lib/udev/rules.d

All Right , i removed my hacks , now:

%> sudo cryptsetup luksClose /dev/mapper/code
%> sudo cryptsetup luksOpen /dev/sda8 code

Kernel Messages:

udevd-work[11168]: kernel-provided name 'dm-1' and NAME= 'mapper/temporary-cryptsetup-11166' disagree, please use SYMLINK+= or change the kernel to provide the proper name

udevd-work[11168]: device node '/dev/mapper/temporary-cryptsetup-11166' already exists, link to '/dev/mapper/temporary-cryptsetup-11166' will not overwrite it

udevd-work[11168]: kernel-provided name 'dm-1' and NAME= 'mapper/code' disagree, please use SYMLINK+= or change the kernel to provide the proper name

udevd-work[11168]: device node '/dev/mapper/code' already exists, link to '/dev/mapper/code' will not overwrite it

Doesn't looks like anybody else , wired problem. I should be able to get rid of those messages , right ?

Many thanks.

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxASZ4ACgkQvf41sEptMqCKhQCfbCvgWy3lAyMPwCmVMpCO5rRr c7oAnRzR4mMJI8FHkS5XUNKC72FeAarS
=Ml7s
-----END PGP SIGNATURE-----

#7 lore raw
Quoted 6 lines

udevd-work[11168]: kernel-provided name 'dm-1' and NAME= 'mapper/code' disagree, please use SYMLINK+= or change the kernel to provide the proper name

Doesn't looks like anybody else , wired problem. I should be able to get rid of those messages , right ?

it is known problem, upgrade package providing dm rules or downgrade udev.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581593#24

But is is just warning, it should still work.

Milan

#8 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 4 lines · Milan Broz

it is known problem, upgrade package providing dm rules or downgrade udev.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=581593#24

But is is just warning, it should still work.

Still work , with a bunch of warnings , and checked udev version on my system , it's
udev-160.

Okay , i'd put this off for a while.

Quoted 3 lines

Milan

- --
Best Regards,
Aaron Lewis - PGP: 0x4A6D32A0
FingerPrint EA63 26B2 6C52 72EA A4A5 EB6B BDFE 35B0 4A6D 32A0
irc: A4r0n on freenode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxAeRcACgkQvf41sEptMqB6DACfRGza28u9akUoa9o17v2GJWfk T+kAnj8JRLdRkrJMeO7MZRHOuijszJ6n
=4tTW
-----END PGP SIGNATURE-----