On Fri, 2016-06-17 at 14:32 +0530, Ritesh Raj Sarraf wrote: > > > To be honest, I'm a little lost now. This last line looks like where the bug > is, > but again, if this is the bug, I can't see a reason why the patch worked on > it. > > Can you run the following command on the device that you create a partition > for? > sudo udevadm info --path /sys/block/dm-0 --query=all > > Where dm-X is your device.
I ran it on my virtual setup. root@debian-btrfs:~# udevadm info --path /sys/block/dm-2 --query=all P: /devices/virtual/block/dm-2 N: dm-2 L: 50 S: disk/by-id/dm-name-36001405226c2409d98a4e35ba427b274-part1 S: disk/by-id/dm-uuid-part1-mpath-36001405226c2409d98a4e35ba427b274 S: disk/by-id/scsi-36001405226c2409d98a4e35ba427b274-part1 S: disk/by-id/wwn-0x6001405226c2409d98a4e35ba427b274-part1 S: mapper/36001405226c2409d98a4e35ba427b274-part1 E: DEVLINKS=/dev/disk/by-id/wwn-0x6001405226c2409d98a4e35ba427b274-part1 /dev/disk/by-id/dm-uuid-part1-mpath-36001405226c2409d98a4e35ba427b274 /dev/mapper/36001405226c2409d98a4e35ba427b274-part1 /dev/disk/by-id/dm-name-36001405226c2409d98a4e35ba427b274-part1 /dev/disk/by-id/scsi-36001405226c2409d98a4e35ba427b274-part1 E: DEVNAME=/dev/dm-2 E: DEVPATH=/devices/virtual/block/dm-2 E: DEVTYPE=disk E: DM_ACTIVATION=1 E: DM_MPATH=36001405226c2409d98a4e35ba427b274 E: DM_NAME=36001405226c2409d98a4e35ba427b274-part1 E: DM_PART=1 E: DM_STATE=ACTIVE E: DM_SUSPENDED=0 E: DM_TABLE_STATE=LIVE E: DM_TYPE=scsi E: DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 E: DM_UDEV_PRIMARY_SOURCE_FLAG=1 E: DM_UDEV_RULES=1 E: DM_UUID=part1-mpath-36001405226c2409d98a4e35ba427b274 E: DM_WWN=0x6001405226c2409d98a4e35ba427b274 E: ID_PART_ENTRY_DISK=253:1 E: ID_PART_ENTRY_NUMBER=1 E: ID_PART_ENTRY_OFFSET=65528 E: ID_PART_ENTRY_SCHEME=dos E: ID_PART_ENTRY_SIZE=2031624 E: ID_PART_ENTRY_TYPE=0x83 E: MAJOR=253 E: MINOR=2 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=339233875 The problem here is: E: DM_UUID=part1-mpath-36001405226c2409d98a4e35ba427b274 and the udev rule's: ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath-*", \ RUN+="/sbin/kpartx -u -p -part /dev/$name" For the whole device, the report is such: root@debian-btrfs:~# udevadm info --path /sys/block/dm-1 --query=all P: /devices/virtual/block/dm-1 N: dm-1 L: 50 S: disk/by-id/dm-name-36001405226c2409d98a4e35ba427b274 S: disk/by-id/dm-uuid-mpath-36001405226c2409d98a4e35ba427b274 S: disk/by-id/scsi-36001405226c2409d98a4e35ba427b274 S: disk/by-id/wwn-0x6001405226c2409d98a4e35ba427b274 S: mapper/36001405226c2409d98a4e35ba427b274 E: DEVLINKS=/dev/disk/by-id/dm-uuid-mpath-36001405226c2409d98a4e35ba427b274 /dev/disk/by-id/scsi-36001405226c2409d98a4e35ba427b274 /dev/mapper/36001405226c2409d98a4e35ba427b274 /dev/disk/by-id/dm-name-36001405226c2409d98a4e35ba427b274 /dev/disk/by-id/wwn-0x6001405226c2409d98a4e35ba427b274 E: DEVNAME=/dev/dm-1 E: DEVPATH=/devices/virtual/block/dm-1 E: DEVTYPE=disk E: DM_NAME=36001405226c2409d98a4e35ba427b274 E: DM_STATE=ACTIVE E: DM_SUSPENDED=0 E: DM_TABLE_STATE=LIVE E: DM_TYPE=scsi E: DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1 E: DM_UDEV_PRIMARY_SOURCE_FLAG=1 E: DM_UDEV_RULES=1 E: DM_UUID=mpath-36001405226c2409d98a4e35ba427b274 E: DM_WWN=0x6001405226c2409d98a4e35ba427b274 E: ID_PART_TABLE_TYPE=dos E: MAJOR=253 E: MINOR=1 E: SUBSYSTEM=block E: TAGS=:systemd: E: USEC_INITIALIZED=24061606 Now I am not sure if DM_UUID being prepended with partN is the correct behavior. Andrew: Do you know about it ? From what I understand, the state of DM_UUID is different in Debian than Upstream. See debian/dmsetup_env for details. Maybe the previous maintainer has the history of this deviation. That said, my previous patch was not correct. I still don't know why it worked for your case. :-) But for Debian, in its current form, perhaps the new (attached) patch will be better. Can you please test it Andrew? I'll also talk to Guido when I get a chance. -- Ritesh Raj Sarraf | http://people.debian.org/~rrs Debian - The Universal Operating System
Handle (broken?) DM Device partitions Debian Bug: #827412 --- a/kpartx/kpartx.rules +++ b/kpartx/kpartx.rules @@ -37,7 +37,7 @@ # Create dm tables for partitions ENV{DM_ACTION}=="PATH_FAILED|PATH_REINSTATED", GOTO="kpartx_end" ENV{DM_NR_VALID_PATHS}=="0", GOTO="kpartx_end" -ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath-*", \ +ENV{DM_STATE}!="SUSPENDED", ENV{DM_UUID}=="mpath*-* | part*-mpath-*", \ RUN+="/sbin/kpartx -u -p -part /dev/$name" LABEL="kpartx_end"
signature.asc
Description: This is a digitally signed message part