Race conditions when creating multiple LVM2 snapshots
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lvm2 (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
udev (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: lvm2
I'm creating several LVM2 snapshots in quick succession for backup. The attached bash script shows what is done.
If I run the script like it is I *always* get error messages on console and in syslog, presumably all coming from udev. The snapshots seem to work fine but I'm a bit uneasy about this.
If I add "sync; sleep 2;" statements between the snapshot commands it gets a bit better, the error messages only show up sporadically then.
The system is an update-to-date x86-64 Karmic installation. Here are the error messages from two runs of the test script + entries in syslog:
# ./btest.sh
pre-backup: creating and mounting snapshots
Logical volume "backup_root" created
Logical volume "backup_usr" created
Path /dev/ACTION=
Logical volume "backup_home" created
Path /dev/ACTION=_add_ no longer valid for device(253,21)
Path /dev/DEVTYPE=_disk_ no longer valid for device(253,21)
Path /dev/PWD=_/_ no longer valid for device(253,21)
Path /dev/DM_
Path /dev/SUBSYSTEM=
Path /dev/DM_
Path /dev/IFS=_ no longer valid for device(253,21)
Path /dev/DM_
Path /dev/UDEV_LOG=_3_ no longer valid for device(253,21)
Path /dev/_ no longer valid for device(253,21)
Logical volume "backup_var_log" created
Path /dev/ACTION=
Path /dev/ACTION=_add_ no longer valid for device(253,24)
Logical volume "backup_var_spool" created
Logical volume "backup_srv_www" created
MySQL: flush tables with read lock
Logical volume "backup_srv_mysql" created
MySQL: unlock tables
pre-backup: snapshots mounted
pre-backup: copying svn repos
post-backup: unmounting and removing snapshots
/dev/
Path /dev/ACTION=_add_ no longer valid for device(253,33)
Path /dev/DEVTYPE=_disk_ no longer valid for device(253,33)
Path /dev/PWD=_/_ no longer valid for device(253,33)
Path /dev/DM_
Logical volume "backup_var_spool" successfully removed
Logical volume "backup_var_log" successfully removed
Logical volume "backup_home" successfully removed
Logical volume "backup_srv_www" successfully removed
Logical volume "backup_srv_mysql" successfully removed
Logical volume "backup_usr" successfully removed
Logical volume "backup_root" successfully removed
post-backup: snapshots removed
# ./btest.sh
pre-backup: creating and mounting snapshots
Logical volume "backup_root" created
Logical volume "backup_usr" created
Path /dev/DEVTYPE=_disk_ no longer valid for device(253,18)
Path /dev/PWD=_/_ no longer valid for device(253,18)
Path /dev/DM_
Path /dev/SUBSYSTEM=
Path /dev/DM_
Path /dev/IFS=_ no longer valid for device(253,18)
Path /dev/DM_
Path /dev/UDEV_LOG=_3_ no longer valid for device(253,18)
Path /dev/PS1=_# no longer valid for device(253,18)
Path /dev/_ no longer valid for device(253,18)
Path /dev/PS2=__ no longer valid for device(253,18)
Path /dev/DM_
Path /dev/DM_
Path /dev/PATH=
Path /dev/PS4=_+ no longer valid for device(253,18)
Path /dev/OPTIND=_1_ no longer valid for device(253,18)
Path /dev/DM_
Path /dev/DM_MAJOR=_253_ no longer valid for device(253,18)
Path /dev/MAJOR=_253_ no longer valid for device(253,18)
Logical volume "backup_home" created
Logical volume "backup_var_log" created
Logical volume "backup_var_spool" created
Logical volume "backup_srv_www" created
MySQL: flush tables with read lock
Logical volume "backup_srv_mysql" created
MySQL: unlock tables
pre-backup: snapshots mounted
pre-backup: copying svn repos
post-backup: unmounting and removing snapshots
Logical volume "backup_var_spool" successfully removed
Logical volume "backup_var_log" successfully removed
Logical volume "backup_home" successfully removed
Logical volume "backup_srv_www" successfully removed
Logical volume "backup_srv_mysql" successfully removed
Logical volume "backup_usr" successfully removed
Logical volume "backup_root" successfully removed
post-backup: snapshots removed
/var/log/syslog:
Nov 17 00:00:39 sphere udevd-work[15754]: rename(
Nov 17 00:00:40 sphere udevd-work[15096]: rename(
Nov 17 00:00:42 sphere udevd-work[15754]: rename(
Nov 17 00:00:43 sphere udevd-work[15096]: rename(
Nov 17 00:00:43 sphere udevd-work[15096]: rename(
Nov 17 00:00:45 sphere udevd-work[15754]: rename(
Nov 17 00:00:46 sphere udevd-work[15096]: rename(
Nov 17 00:00:51 sphere udevd-work[15096]: last message repeated 3 times
Nov 17 00:00:51 sphere udevd-work[15754]: rename(
Nov 17 00:00:51 sphere udevd-work[15096]: rename(
Nov 17 00:00:53 sphere udevd-work[15754]: rename(
Nov 17 00:00:54 sphere udevd-work[15096]: rename(
Nov 17 00:00:56 sphere udevd-work[15754]: rename(
Nov 17 00:00:56 sphere udevd-work[15096]: rmdir(/dev/) failed: Device or resource busy
rmdir(/dev/)? What the heck?
Not convinced it's a duplicate of 444563, but perhaps related. I have a script that creates snapshots of / and /var in succession, and often receive the same strange error message the reporter notes above:
lvcreate --size 4GB --snapshot --name root-snap-20091123b /dev/vg0/root 20091123b" created
Logical volume "root-snap-
lvcreate --size 16GB --snapshot --name var-snap-20091123b /dev/vg1/var _change_ no longer valid for device(252,10) 20091123b" created
Path /dev/ACTION=
Logical volume "var-snap-
This is accompanied by "Invalid cross-device link" errors in syslog.