# [SOLVED] during boot: /dev/mapper/xxx already exists...

## JohnBlbec

hi everybody,

i know it is not a critical issue, but it is very annoying. a whole message is udevd-work[xxx]: device node /dev/mapper/xxx already exists, link to /dev/mapper/xxx will not overwrite it."

i have read many posts where it has been solved, but nothing helps me :-(

for example:

1) https://forums.gentoo.org/viewtopic-t-819367-view-previous.html

2) https://bugs.gentoo.org/295186

3) https://bugs.gentoo.org/show_bug.cgi?id=325705

i am using x86_64, baselayout-2, gentoo-sources-2.6.35-r5, lvm2-2.02.73 and udev-151-r4. my /etc/udev/rules.d/64-device-mapper.rules contains KERNEL=="device-mapper", NAME="mapper/control" and not KERNEL=="device-mapper", SYMLINK+="mapper/control". 

i really do not know what to do to solve the issue. what is a root cause?

any help or advice, please?Last edited by JohnBlbec on Sat Jun 11, 2011 12:23 pm; edited 2 times in total

----------

## avx

Are you booting an encrypted system with a custom initrd? If so, please post your selfmade /init.

----------

## JohnBlbec

 *avx wrote:*   

> Are you booting an encrypted system with a custom initrd? If so, please post your selfmade /init.

 

i am using initrd (genkernel for a kernel compilation) but w/o encrypted partition and w/o custom changes

----------

## cach0rr0

I pose this question out of pure ignorance as to what devtmpfs does, but is it not possible devtmpfs has created this ? 

(I remember loads of hype about devtmpfs, but for the life of me never found any sort of simpleton documentation as to what it does and does not do)

----------

## JohnBlbec

 *cach0rr0 wrote:*   

> I pose this question out of pure ignorance as to what devtmpfs does, but is it not possible devtmpfs has created this ? 
> 
> (I remember loads of hype about devtmpfs, but for the life of me never found any sort of simpleton documentation as to what it does and does not do)

 

unfortunately, i do not know. the warnings have appeared in the kernel 2.6.34 and it is continuing in 2.6.35. the version 2.6.33 was ok.

----------

## cach0rr0

 *JohnBlbec wrote:*   

> 
> 
> unfortunately, i do not know. the warnings have appeared in the kernel 2.6.34 and it is continuing in 2.6.35. the version 2.6.33 was ok.

 

suppose it's easy enough to see if it's even enabled in your config

```

# zgrep -i devtmpfs /proc/config.gz 

# CONFIG_DEVTMPFS is not set

```

if yours is also unset, disregard that idea entirely  :Smile: 

----------

## JohnBlbec

 *cach0rr0 wrote:*   

>  *JohnBlbec wrote:*   
> 
> unfortunately, i do not know. the warnings have appeared in the kernel 2.6.34 and it is continuing in 2.6.35. the version 2.6.33 was ok. 
> 
> suppose it's easy enough to see if it's even enabled in your config
> ...

 

```

 ~ $ grep CONFIG_DEVTMPFS /etc/kernels/kernel-config-x86_64-2.6.35-gentoo-r5 

# CONFIG_DEVTMPFS is not set

```

----------

## JohnBlbec

no advices?

----------

## ruivilela

Solution on Link 1) worked for me in 2.6.35.

----------

## JohnBlbec

 *ruivilela wrote:*   

> Solution on Link 1) worked for me in 2.6.35.

 

interesting. do you think could you paste your /etc/udev/rules.d/64-device-mapper.rules here, please?

this is my: $ cat /etc/udev/rules.d/64-device-mapper.rules

```

# do not edit this file, it will be overwritten on update

KERNEL=="device-mapper", NAME="mapper/control"

KERNEL!="dm-*", GOTO="device_mapper_end"

ACTION!="add|change", GOTO="device_mapper_end"

IMPORT{program}="/sbin/dmsetup info --export -j%M -m%m"

ENV{DM_NAME}!="?*", GOTO="device_mapper_end"

NAME="mapper/$env{DM_NAME}", SYMLINK+="%k"

SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}", OPTIONS+="string_escape=replace"

ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}", OPTIONS+="string_escape=replace"

ENV{DM_SUSPENDED}=="1", GOTO="device_mapper_end"

ENV{DM_EXISTS}=="0", GOTO="device_mapper_end"

ENV{DM_TARGET_TYPES}=="|*error*", GOTO="device_mapper_end"

IMPORT{program}="/sbin/blkid -o udev -p $tempnode"

OPTIONS+="link_priority=-100"

OPTIONS+="watch"

ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS+="link_priority=-90"

ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"

ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"

LABEL="device_mapper_end"

```

----------

## Yamakuzure

I had this, too with /dev/mapper/control. It didn't break anything, so I never cared. The message appeared sometime around the time I installed kernel 2.6.32, and never went away.

However, when I upgraded to 2.6.35, I decided to add devtmpfs to the kernel and let it automount to /dev. So with no predefined /dev needed, I booted from a CD, mounted my root drive, and deleted everything from /dev but "console", "null" and "zero".

Now the message is gone and everything works like a charm.

----------

## rufnut

I had some issues with genkernel not finding my swap or anything in /dev/mapper recently and it was cured by downgrading lvm2 to sys-fs/lvm2-2.02.67-r2.

Hope this helps.

 :Smile: 

----------

## JohnBlbec

 *Yamakuzure wrote:*   

> I had this, too with /dev/mapper/control. It didn't break anything, so I never cared. The message appeared sometime around the time I installed kernel 2.6.32, and never went away.
> 
> However, when I upgraded to 2.6.35, I decided to add devtmpfs to the kernel and let it automount to /dev. So with no predefined /dev needed, I booted from a CD, mounted my root drive, and deleted everything from /dev but "console", "null" and "zero".
> 
> Now the message is gone and everything works like a charm.

 

oops i am afraid of trying your way and i would like to find out a root cause not a workaround only, but thanks for your advice. what do you think - is it lvm2 or udev bug? who should i contact or where to send a bug report?

----------

## JohnBlbec

 *rufnut wrote:*   

> I had some issues with genkernel not finding my swap or anything in /dev/mapper recently and it was cured by downgrading lvm2 to sys-fs/lvm2-2.02.67-r2.
> 
> Hope this helps.
> 
>  :)

 

i will try to downgrade during this week-end...

----------

## Yamakuzure

Well, it is no real workaround, but an upgrade going udev: *Quote:*   

> Maintain a devtmpfs filesystem to mount at /dev (DEVTMPFS)
> 
> CONFIG_DEVTMPFS:
> 
> This creates a tmpfs/ramfs filesystem instance early at bootup.
> ...

 And: *Quote:*   

> Automount devtmpfs at /dev, after the kernel mounted the rootfs (DEVTMPFS_MOUNT)
> 
> CONFIG_DEVTMPFS_MOUNT:
> 
> This will instruct the kernel to automatically mount the devtmpfs filesystem at /dev, directly after the kernel has mounted the root filesystem. The behavior can be overridden with the commandline parameter: devtmpfs.mount=0|1.
> ...

 So for this I left console, zero and null in there, because those three are everything needed until udev populates /dev on it's own, and I want to try out without CONFIG_DEVTMPFS_MOUNT this weekend.  :Wink: 

(Note: The kernel builds up a really full /dev. It's a ram disk, so I do not really care, but most stuff in there isn't neede. I'll go and look what udev populates on it's own.)

----------

## JohnBlbec

 *Yamakuzure wrote:*   

> Well, it is no real workaround, but an upgrade going udev: *Quote:*   Maintain a devtmpfs filesystem to mount at /dev (DEVTMPFS)
> 
> CONFIG_DEVTMPFS:
> 
> This creates a tmpfs/ramfs filesystem instance early at bootup.
> ...

 

devtmpfs reminds me devfs and i did not like devfs :-( btw. devfs is deprecated, is not it?

i think there must be another solution but thanks for the explanation. i can not make experiments because it is my production desktop.

----------

## ruivilela

 *Quote:*   

> 
> 
> # do not edit this file, it will be overwritten on update
> 
> #KERNEL=="device-mapper", SYMLINK+="mapper/control"
> ...

 

Here. There is a comment to not edit this file. I edit the 3rd/4th line

----------

## JohnBlbec

 *ruivilela wrote:*   

>  *Quote:*   
> 
> # do not edit this file, it will be overwritten on update
> 
> #KERNEL=="device-mapper", SYMLINK+="mapper/control"
> ...

 

have a look above, i am using this file with the same content and there are warnings during boot :-(

----------

## ruivilela

Can you see the file permissions to this file, should be similar to others.

And second thing:

in /etc/conf.d/rc

 *Quote:*   

> 
> 
> # UDEV OPTION:
> 
> # Set to "yes" if you want to save /dev to a tarball on shutdown
> ...

 

If you have yes, try no and reboot.

----------

## JohnBlbec

 *ruivilela wrote:*   

> Can you see the file permissions to this file, should be similar to others.
> 
> And second thing:
> 
> in /etc/conf.d/rc
> ...

 

# ls -la /etc/udev/rules.d/

```

total 36

drwxr-xr-x 2 root root 4096 Aug  7 15:54 .

drwxr-xr-x 3 root root 4096 Aug  4 15:51 ..

-rw-r--r-- 1 root root    0 Aug  4 15:51 .keep_sys-fs_udev-0

-rw-r--r-- 1 root root 1100 Apr 25 20:42 64-device-mapper.rules

-rw-r--r-- 1 root root 4157 May 17 17:09 70-openct.rules

-rw-r--r-- 1 root root 2085 Jan  9  2010 70-persistent-cd.rules

-rw-r--r-- 1 root root  376 Aug  4 15:51 70-persistent-net.rules

-rw-r--r-- 1 root root   83 Jun 25 16:41 90-hal.rules

-rw-r--r-- 1 root root   28 Dec 30  2009 99-fuse.rule

```

i am using openrc and baselayout-2 so there is no /etc/conf.d/rc

btw. maybe it helps i am using hw (i have not mentioned it) raid5 and many lvm2 volumes:

 # ls -la /dev/raid5

```

total 0

drwxr-xr-x  2 root root  260 Sep 11 11:46 .

drwxr-xr-x 16 root root 4000 Sep 11 11:46 ..

lrwxrwxrwx  1 root root   22 Sep 11 11:46 ccache -> ../mapper/raid5-ccache

lrwxrwxrwx  1 root root   25 Sep 11 11:46 distfiles -> ../mapper/raid5-distfiles

lrwxrwxrwx  1 root root   20 Sep 11 11:46 home -> ../mapper/raid5-home

lrwxrwxrwx  1 root root   21 Sep 11 11:46 media -> ../mapper/raid5-media

lrwxrwxrwx  1 root root   19 Sep 11 11:46 opt -> ../mapper/raid5-opt

lrwxrwxrwx  1 root root   23 Sep 11 11:46 portage -> ../mapper/raid5-portage

lrwxrwxrwx  1 root root   20 Sep 11 11:46 swap -> ../mapper/raid5-swap

lrwxrwxrwx  1 root root   19 Sep 11 11:46 tmp -> ../mapper/raid5-tmp

lrwxrwxrwx  1 root root   19 Sep 11 11:46 usr -> ../mapper/raid5-usr

lrwxrwxrwx  1 root root   19 Sep 11 11:46 var -> ../mapper/raid5-var

lrwxrwxrwx  1 root root   22 Sep 11 11:46 vartmp -> ../mapper/raid5-vartmp

```

----------

## ruivilela

 *JohnBlbec wrote:*   

>  *ruivilela wrote:*   Can you see the file permissions to this file, should be similar to others.
> 
> And second thing:
> 
> in /etc/conf.d/rc
> ...

 

I did not know about this OpenRC. Seems I am outdated. But is still masked. Theis a subchapter about udev in the openrc migration document.

----------

## JohnBlbec

 *Quote:*   

> I did not know about this OpenRC. Seems I am outdated. But is still masked. Theis a subchapter about udev in the openrc migration document.

 

i have no openrc migration troubles. i am using openrc about 2 years w/o problems. my udev (lvm2) troubles have started from kernel 2.6.32. there must be a bug :-(

----------

## ruivilela

See this: http://tldp.org/HOWTO/LVM-HOWTO/lvm2faq.html

Iam using cryptsetup, and today I had a problem with mounting an encripted partitation due to a problem with the device-mapper. But it was ony the cryptsetup that changed the default cipher from aes to plain.

----------

## JohnBlbec

 *ruivilela wrote:*   

> See this: http://tldp.org/HOWTO/LVM-HOWTO/lvm2faq.html
> 
> Iam using cryptsetup, and today I had a problem with mounting an encripted partitation due to a problem with the device-mapper. But it was ony the cryptsetup that changed the default cipher from aes to plain.

 

sorry i do not understand - how is it related to this issue/topic?

----------

## ruivilela

 *JohnBlbec wrote:*   

>  *ruivilela wrote:*   See this: http://tldp.org/HOWTO/LVM-HOWTO/lvm2faq.html
> 
> Iam using cryptsetup, and today I had a problem with mounting an encripted partitation due to a problem with the device-mapper. But it was ony the cryptsetup that changed the default cipher from aes to plain. 
> 
> sorry i do not understand - how is it related to this issue/topic?

 

That udev has a bug (maybe) due to recent changes in lvm2. I was using device-mapper ebuild before I updated the system. The lvm2 got installed because cryptsetup and parted depends of it. I'm not using any logic volume on my system.

----------

## JohnBlbec

 *ruivilela wrote:*   

>  *JohnBlbec wrote:*    *ruivilela wrote:*   See this: http://tldp.org/HOWTO/LVM-HOWTO/lvm2faq.html
> 
> Iam using cryptsetup, and today I had a problem with mounting an encripted partitation due to a problem with the device-mapper. But it was ony the cryptsetup that changed the default cipher from aes to plain. 
> 
> sorry i do not understand - how is it related to this issue/topic? 
> ...

 

oops, i understand now. i think so.

----------

## JohnBlbec

it is unbelievable how the time is flying  :Surprised: 

one year is away and the annoying warning messages are still here  :Sad: 

i am using sys-fs/udev-151-r4 and sys-fs/lvm2-2.02.73-r1

----------

## JohnBlbec

my troubles gone away deleting /etc/udev/rules.d/64-device-mapper.rules

(just note: i do not have device-mapper installed)

----------

## VoidMage

 *JohnBlbec wrote:*   

> my troubles gone away deleting /etc/udev/rules.d/64-device-mapper.rules
> 
> (just note: i do not have device-mapper installed)

 

Well, that's pretty obvious you both have and can't have it installed - quite awhile ago, device-mapper had been a separate package, but was merged into lvm2.

----------

## JohnBlbec

 *VoidMage wrote:*   

>  *JohnBlbec wrote:*   my troubles gone away deleting /etc/udev/rules.d/64-device-mapper.rules
> 
> (just note: i do not have device-mapper installed) 
> 
> Well, that's pretty obvious you both have and can't have it installed - quite awhile ago, device-mapper had been a separate package, but was merged into lvm2.

 

yes, that is right. device-mapper has been merged to lvm2, but i spoke sys-fs/device-mapper package about. probably this one should remove its own files and this one did not do that.

----------

