Bug 1241774
Summary: | blkid doesn't output PART_ENTRY_DISK for a partition on the dm device with sun label | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Masahiro Matsuya <mmatsuya> | |
Component: | device-mapper-multipath | Assignee: | Ben Marzinski <bmarzins> | |
Status: | CLOSED ERRATA | QA Contact: | Lin Li <lilin> | |
Severity: | medium | Docs Contact: | Steven J. Levine <slevine> | |
Priority: | medium | |||
Version: | 7.1 | CC: | agk, bmarzins, heinzm, lilin, msnitzer, prajnoha | |
Target Milestone: | rc | Keywords: | Triaged | |
Target Release: | --- | |||
Hardware: | All | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | device-mapper-multipath-0.4.9-87.el7 | Doc Type: | Bug Fix | |
Doc Text: |
The `kpartx` generated devices now have the same partition number as the actual partition number
Previously, the `kpartx` generated device partition number did not match with the actual partition number. This was because `kpartx` was not counting sun partitions with no sectors when determining the partition number. With this fix, `kpartx` now counts sun partitions with no sectors when determining the partition number and the `kpartx` generated devices now have the same partition number as the actual partition number.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1251250 1299589 (view as bug list) | Environment: | ||
Last Closed: | 2016-11-04 08:12:34 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1203710, 1251250, 1295577, 1299589, 1313485 |
Description
Masahiro Matsuya
2015-07-10 05:35:35 UTC
After some investigation, I found kpartx (from device-mapper-multipath) set the uuid in read_sun_pt() in kpartx/sun.c. It read some blocks in the multipath device and get the 8 partition information. $9 = { {start_cylinder = 0, num_sectors = 0}, {start_cylinder = 0, num_sectors = 1078071040}, {start_cylinder = 0, num_sectors = 351010560}, {start_cylinder = 0, num_sectors = 0}, {start_cylinder = 0, num_sectors = 0}, {start_cylinder = 0, num_sectors = 0}, {start_cylinder = 0, num_sectors = 0}, {start_cylinder = 1056964608, num_sectors = 2507796480}} The partitions with num_sectors = 0 are skipped, and get the following partition list including the 3 partitions. (gdb) print slices[0] $16 = {start = 0, size = 1000000, major = 0, minor = 0} (gdb) print slices[1] $17 = {start = 0, size = 16771860, major = 0, minor = 0} (gdb) print slices[2] $18 = {start = 1012095, size = 15759765, major = 0, minor = 0} slices[0] is the partition 2 in the disk with the sun label. slices[1] is the whole disk. slices[2] is the partition 8 in the disk with the sun label. slices[1] is ignored since it's overlapped with slices[2]. kpartx uses the index of slices[] array for the partition number in uuid. Precisely, it's index+1. For the partition 2, part1-xxx For the partition 8, part3-xxx So, the partition number in uuid doesn't match the partition number (2 and 8) in the disk with sun label. I was not sure which component it's fixed in. util-linux or device-mapper-multipath. If it's fixed in device-mapper-multipath, the patch should be like this. diff -up multipath-tools-130222/kpartx/sun.c.original multipath-tools-130222/kpartx/sun.c --- multipath-tools-130222/kpartx/sun.c.original 2015-07-10 17:32:47.763111142 +0900 +++ multipath-tools-130222/kpartx/sun.c 2015-07-10 17:33:27.363111142 +0900 @@ -82,8 +82,6 @@ read_sun_pt(int fd, struct slice all, st for(i=0, n=0; i<SUN_DISK_MAXPARTITIONS; i++) { s = &l->partitions[i]; - if (s->num_sectors == 0) - continue; if (n < ns) { sp[n].start = offset + be32_to_cpu(s->start_cylinder) * be16_to_cpu(l->nsect) * be16_to_cpu(l->ntrks); I'll change the component into device-mapper-multipath. I've fixed the issue where kpartx is not correctly naming the partition device. However, as you mentioned in Comment 2, this appears to be unrelated to the blkid issue. Specifically, the blkid issue occurs exactly the same on a regular scsi device, without multipath being involved at all. kpartx now correctly counts the zero sector sized partitions when determining that partition number, and names the partition devices correctly. Reproduced on device-mapper-multipath-0.4.9-77.el7 1. # rpm -qa | grep multipath device-mapper-multipath-0.4.9-77.el7.x86_64 device-mapper-multipath-libs-0.4.9-77.el7.x86_64 2.# multipath -ll mpatha (360fff19abdd9552f8a36e5355226ba27) dm-0 EQLOGIC ,100E-00 size=50G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 3:0:0:0 sdb 8:16 active ready running `-+- policy='service-time 0' prio=1 status=enabled `- 4:0:0:0 sdc 8:32 active ready running 3.# fdisk -l /dev/mapper/mpatha Disk /dev/mapper/mpatha (Sun disk label): 64 heads, 32 sectors, 51210 cylinders Units = sectors of 1 * 512 bytes Device Flag Start End Blocks Id System /dev/mapper/mpatha2 u 104775680 104878080 51200 82 Linux swap /dev/mapper/mpatha3 0 104878080 52439040 5 Whole disk /dev/mapper/mpatha8 45056 345666 150305 83 Linux native 4.# parted /dev/mapper/mpatha GNU Parted 3.1 Using /dev/mapper/mpatha Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: Linux device-mapper (multipath) (dm) Disk /dev/mapper/mpatha: 53.7GB Sector size (logical/physical): 512B/512B Partition Table: sun Disk Flags: Number Start End Size File system Flags 8 23.1MB 177MB 154MB 2 53.6GB 53.7GB 52.4MB 5.# ls -l /dev/mapper/mpatha* lrwxrwxrwx. 1 root root 7 Jul 16 15:14 /dev/mapper/mpatha -> ../dm-0 lrwxrwxrwx. 1 root root 7 Jul 16 2016 /dev/mapper/mpatha1 -> ../dm-1 lrwxrwxrwx. 1 root root 7 Jul 16 2016 /dev/mapper/mpatha2 -> ../dm-2 6.# blkid -po udev /dev/mapper/mpatha1 ID_FS_UUID=dc3cae86-81ea-406e-9207-05a857264a0c ID_FS_UUID_ENC=dc3cae86-81ea-406e-9207-05a857264a0c ID_FS_TYPE=xfs ID_FS_USAGE=filesystem 7.# blkid -po udev /dev/mapper/mpatha2 ID_FS_UUID=AiQMMf-nFYA-Kita-GweC-NuPx-ScQl-i3WOHl ID_FS_UUID_ENC=AiQMMf-nFYA-Kita-GweC-NuPx-ScQl-i3WOHl ID_FS_VERSION=LVM2\x20001 ID_FS_TYPE=LVM2_member ID_FS_USAGE=raid Verified on device-mapper-multipath-0.4.9-93.el7 1. # rpm -qa | grep multipath device-mapper-multipath-libs-0.4.9-93.el7.x86_64 device-mapper-multipath-0.4.9-93.el7.x86_64 device-mapper-multipath-sysvinit-0.4.9-93.el7.x86_64 device-mapper-multipath-debuginfo-0.4.9-93.el7.x86_64 2.# multipath -ll mpatha (36001405848565fc8934460cac7148f3d) dm-0 LIO-ORG ,st72-io size=10G features='0' hwhandler='0' wp=rw |-+- policy='service-time 0' prio=1 status=active | `- 3:0:0:0 sdb 8:16 active ready running `-+- policy='service-time 0' prio=1 status=enabled `- 4:0:0:0 sdc 8:32 active ready running 3.# fdisk -l /dev/mapper/mpatha Disk /dev/mapper/mpatha (Sun disk label): 64 heads, 32 sectors, 10240 cylinders Units = sectors of 1 * 512 bytes Device Flag Start End Blocks Id System /dev/mapper/mpatha2 u 20869120 20971520 51200 82 Linux swap /dev/mapper/mpatha3 0 20971520 10485760 5 Whole disk /dev/mapper/mpatha8 346112 435678 44783 83 Linux native 4.# parted /dev/mapper/mpatha GNU Parted 3.1 Using /dev/mapper/mpatha Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: Linux device-mapper (multipath) (dm) Disk /dev/mapper/mpatha: 10.7GB Sector size (logical/physical): 512B/512B Partition Table: sun Disk Flags: Number Start End Size File system Flags 8 177MB 223MB 45.9MB 2 10.7GB 10.7GB 52.4MB 5.# ls -l /dev/mapper/mpatha* lrwxrwxrwx. 1 root root 7 Jul 16 15:34 /dev/mapper/mpatha -> ../dm-0 lrwxrwxrwx. 1 root root 7 Jul 16 12:00 /dev/mapper/mpatha1 -> ../dm-1 lrwxrwxrwx. 1 root root 7 Jul 16 15:34 /dev/mapper/mpatha2 -> ../dm-6 lrwxrwxrwx. 1 root root 7 Jul 16 12:00 /dev/mapper/mpatha3 -> ../dm-7 lrwxrwxrwx. 1 root root 8 Jul 16 15:34 /dev/mapper/mpatha8 -> ../dm-10 the partition 2 is /dev/mapper/mpatha2, and the partition 8 is /dev/mapper/mpatha8. 6.# # blkid -po udev /dev/mapper/mpatha2 ID_PART_ENTRY_SCHEME=sun ID_PART_ENTRY_TYPE=0x82 ID_PART_ENTRY_FLAGS=0x1 ID_PART_ENTRY_NUMBER=2 ID_PART_ENTRY_OFFSET=20869120 ID_PART_ENTRY_SIZE=102400 ID_PART_ENTRY_DISK=253:0 7.# blkid -po udev /dev/mapper/mpatha8 ID_PART_ENTRY_SCHEME=sun ID_PART_ENTRY_TYPE=0x83 ID_PART_ENTRY_NUMBER=8 ID_PART_ENTRY_OFFSET=346112 ID_PART_ENTRY_SIZE=89566 ID_PART_ENTRY_DISK=253:0 Test result: the kpartx generated devices have the same partition number as the actual partition number Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2536.html |