Christoph Mitasch
2015-06-11 11:04:56 UTC
Hello,
we are using a DRBD handler that is removing and creating LVM snaphots on a Ubuntu 12.04 with kernel 3.2.0-84.
We found out that both lvmremove and lvmcreate hangs for about 1min most of the times. It seems to be related to udev.
***@server:~# bash -x lvmsnaploop.sh
+ i=0
+ '[' 0 -lt 100 ']'
+ i=1
+ lvcreate -s -n test -L 1000k local/r1-U
Rounding up size to full physical extent 4,00 MiB
Logical volume "test" created
real 0m0.515s
user 0m0.008s
sys 0m0.024s
+ lvremove -f /dev/local/test
Logical volume "test" successfully removed
real 1m0.991s
user 0m0.012s
sys 0m0.020s
+ '[' 1 -lt 100 ']'
+ i=2
+ lvcreate -s -n test -L 1000k local/r1-U
Rounding up size to full physical extent 4,00 MiB
Logical volume "test" created
real 1m1.059s
user 0m0.004s
sys 0m0.028s
---
The log also shows the watershed process calling vgscan and vgchange is getting killed after a timeout.
Jun 11 12:51:45 server udevd[22866]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25071]
Jun 11 12:51:45 server udevd[22867]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25079]
Jun 11 12:51:45 server udevd[22867]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25079] terminated by signal 9 (Killed)
Jun 11 12:51:45 server udevd[22866]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25071] terminated by signal 9 (Killed)
Jun 11 12:51:45 server udevd[23202]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25109]
Jun 11 12:51:45 server udevd[23202]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25109] terminated by signal 9 (Killed)
Jun 11 12:51:45 server udevd[23202]: inotify_add_watch(6, /dev/dm-0, 10) failed: No such file or directory
Jun 11 12:51:45 server udevd[23200]: inotify_add_watch(6, /dev/dm-0, 10) failed: No such file or directory
Jun 11 12:51:45 server udevd[23200]: inotify_add_watch(6, /dev/dm-0, 10) failed: No such file or directory
Jun 11 12:52:46 server udevd[22866]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25122]
Jun 11 12:52:46 server udevd[22867]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25126]
Jun 11 12:52:46 server udevd[22867]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25126] terminated by signal 9 (Killed)
Jun 11 12:52:46 server udevd[22866]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25122] terminated by signal 9 (Killed)
Jun 11 12:53:47 server udevd[22866]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25169]
Jun 11 12:53:47 server udevd[22866]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25169] terminated by signal 9 (Killed)
Jun 11 12:53:47 server udevd[22867]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25177]
Jun 11 12:53:47 server udevd[22867]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25177] terminated by signal 9 (Killed)
Jun 11 12:53:47 server udevd[23250]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25201]
Jun 11 12:53:47 server udevd[23250]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25201] terminated by signal 9 (Killed)
If we add "--noudevsync" to the lvcreate/-remove command everything wents smooth.
The following udev rules seems to cause the issue.
***@server:/lib/udev/rules.d# cat 85-lvm2.rules
# This file causes block devices with LVM signatures to be automatically
# added to their volume group.
# See udev(8) for syntax
SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="lvm*|LVM*", \
RUN+="watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'"
Is calling "noudevsync" an option or is there any other way to fix that problem?
Thank you,
Christoph
we are using a DRBD handler that is removing and creating LVM snaphots on a Ubuntu 12.04 with kernel 3.2.0-84.
We found out that both lvmremove and lvmcreate hangs for about 1min most of the times. It seems to be related to udev.
***@server:~# bash -x lvmsnaploop.sh
+ i=0
+ '[' 0 -lt 100 ']'
+ i=1
+ lvcreate -s -n test -L 1000k local/r1-U
Rounding up size to full physical extent 4,00 MiB
Logical volume "test" created
real 0m0.515s
user 0m0.008s
sys 0m0.024s
+ lvremove -f /dev/local/test
Logical volume "test" successfully removed
real 1m0.991s
user 0m0.012s
sys 0m0.020s
+ '[' 1 -lt 100 ']'
+ i=2
+ lvcreate -s -n test -L 1000k local/r1-U
Rounding up size to full physical extent 4,00 MiB
Logical volume "test" created
real 1m1.059s
user 0m0.004s
sys 0m0.028s
---
The log also shows the watershed process calling vgscan and vgchange is getting killed after a timeout.
Jun 11 12:51:45 server udevd[22866]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25071]
Jun 11 12:51:45 server udevd[22867]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25079]
Jun 11 12:51:45 server udevd[22867]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25079] terminated by signal 9 (Killed)
Jun 11 12:51:45 server udevd[22866]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25071] terminated by signal 9 (Killed)
Jun 11 12:51:45 server udevd[23202]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25109]
Jun 11 12:51:45 server udevd[23202]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25109] terminated by signal 9 (Killed)
Jun 11 12:51:45 server udevd[23202]: inotify_add_watch(6, /dev/dm-0, 10) failed: No such file or directory
Jun 11 12:51:45 server udevd[23200]: inotify_add_watch(6, /dev/dm-0, 10) failed: No such file or directory
Jun 11 12:51:45 server udevd[23200]: inotify_add_watch(6, /dev/dm-0, 10) failed: No such file or directory
Jun 11 12:52:46 server udevd[22866]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25122]
Jun 11 12:52:46 server udevd[22867]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25126]
Jun 11 12:52:46 server udevd[22867]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25126] terminated by signal 9 (Killed)
Jun 11 12:52:46 server udevd[22866]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25122] terminated by signal 9 (Killed)
Jun 11 12:53:47 server udevd[22866]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25169]
Jun 11 12:53:47 server udevd[22866]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25169] terminated by signal 9 (Killed)
Jun 11 12:53:47 server udevd[22867]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25177]
Jun 11 12:53:47 server udevd[22867]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25177] terminated by signal 9 (Killed)
Jun 11 12:53:47 server udevd[23250]: timeout: killing 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25201]
Jun 11 12:53:47 server udevd[23250]: 'watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'' [25201] terminated by signal 9 (Killed)
If we add "--noudevsync" to the lvcreate/-remove command everything wents smooth.
The following udev rules seems to cause the issue.
***@server:/lib/udev/rules.d# cat 85-lvm2.rules
# This file causes block devices with LVM signatures to be automatically
# added to their volume group.
# See udev(8) for syntax
SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="lvm*|LVM*", \
RUN+="watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange -a y'"
Is calling "noudevsync" an option or is there any other way to fix that problem?
Thank you,
Christoph