Bug#777462: kpartx_id generates wrong WWN
Ferenc Wágner
wferi at niif.hu
Sun Feb 8 12:45:18 UTC 2015
Package: kpartx
Version: 0.5.0-5
Severity: normal
Hi,
I've got an iSCSI rooted jessie system. /etc/multipath.conf defines the
following alias for the (multipathed and dm-crypted) disk:
multipaths {
multipath {
wwid 3600000e00d1100000011043c00320000
alias repce_disk
}
}
All is well, except that
$ ls -l /dev/disk/by-id/wwn-*
lrwxrwxrwx 1 root root 10 Feb 8 08:31 /dev/disk/by-id/wwn-0x600000e00d1100000011043c00320000 -> ../../dm-0
lrwxrwxrwx 1 root root 10 Feb 7 16:37 /dev/disk/by-id/wwn-0x600000e00d1100000011043c00320000-part1 -> ../../sdj1
lrwxrwxrwx 1 root root 10 Feb 7 16:37 /dev/disk/by-id/wwn-0x600000e00d1100000011043c00320000-part2 -> ../../sdj2
lrwxrwxrwx 1 root root 10 Feb 8 08:49 /dev/disk/by-id/wwn-0xeneric_USB_Flash_Disk_000000000000001000000993-0:0 -> ../../dm-8
lrwxrwxrwx 1 root root 10 Feb 8 08:31 /dev/disk/by-id/wwn-0xepce_disk-part1 -> ../../dm-2
lrwxrwxrwx 1 root root 10 Feb 8 08:31 /dev/disk/by-id/wwn-0xepce_disk-part2 -> ../../dm-3
that is, I find wwn-0xepce_disk-part1 and similar links, containing
device names missing their first characters. Here, a USB flash disk
is also inserted in the system.
# multipath -ll
Generic_USB_Flash_Disk_000000000000001000000993-0:0 dm-8 ,
size=1.9G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=0 status=active
`- #:#:#:# - #:# active faulty running
repce_disk (3600000e00d1100000011043c00320000) dm-0 FUJITSU,ETERNUS_DXL
size=27G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='service-time 0' prio=50 status=active
| |- 0:0:0:0 sda 8:0 active ready running
| |- 12:0:0:0 sdd 8:48 active ready running
| |- 14:0:0:0 sdg 8:96 active ready running
| `- 13:0:0:0 sdj 8:144 active ready running
`-+- policy='service-time 0' prio=10 status=enabled
|- 10:0:0:0 sdi 8:128 active ready running
|- 11:0:0:0 sdh 8:112 active ready running
|- 8:0:0:0 sde 8:64 active ready running
`- 9:0:0:0 sdf 8:80 active ready running
The problem seems to stem from
# udevadm info -q property -n dm-2 | fgrep DM_UUID
DM_UUID=part1-mpath-3600000e00d1100000011043c00320000
# /lib/udev/kpartx_id 254 2 part1-mpath-3600000e00d1100000011043c00320000
DM_NAME=repce_disk
DM_MPATH=3600000e00d1100000011043c00320000
DM_PART=1
DM_TYPE=scsi
DM_WWN=0xepce_disk
which suggests that
echo "DM_WWN=0x${dmname#?}"
in /lib/udev/kpartx_id is not correct in general, as the WWN is not always
contained in the device name. At least not for aliased multipath devices
and plain USB flash disks (which shouldn't be multipathed anyway, but I
neglected to blacklist them until now). Please find a more robust way to
determine the WWN.
--
Thanks,
Feri.
More information about the pkg-lvm-maintainers
mailing list