The full error message text, from syslog is
Code:
inotify_add_watch(6, /dev/dm-4, 10) failed: No such file or directory
According to the inotify_add_watch man page, the 10 is a bitmask documented in the inotify (7) man page with meanings as assigned in /usr/include/linux/inotify.h.
- If it is hexadecimal it means "Unwrittable file closed" (sic)
- If it is decimal it is 0x8 and 0x2 and means ""Unwrittable file closed" (sic) and "File was modified"
- If it is binary it means "File was modified"
None of those fit well with the presumed intention of detecting a u/mount event to a device-mapper device (in this case an LVM snapshot). The 3rd interpretation would fit with detecting a write event.
The inotify_add_watch may be run by udev via a rule in /lib/udev/rules.d/80-udisks.rules, which is part of the udisks package:
Code:
# Make udevd synthesize a 'change' uevent when last opener of a rw-fd closes the fd - this
# should be part of the device-mapper rules
KERNEL=="dm-*", OPTIONS+="watch"
Similar error messages appear for LVM snapshots which are successfully removed by lvremove; no such message appears for a snapshot that lvremove does not remove with message "
Can't remove open logical volume "snap-var"".
I am trying to understand what is going on with the intention of finding a workaround; the best related discussion was found in a Red Hat bug report at
https://bugzilla.redhat.com/show_bug.cgi?id=753105
In case it makes any difference, this is on an ubuntu 12.04 server with lvm2 2.02.66, udev 175-0 and udisks 1.0.4