RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1300964 - Partitions are not correctly recognized in LVM2 when using devices/external_device_info_source="udev"
Summary: Partitions are not correctly recognized in LVM2 when using devices/external_d...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.8
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Peter Rajnoha
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-22 08:50 UTC by Peter Rajnoha
Modified: 2016-05-11 01:20 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.141-1.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-11 01:20:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0964 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2016-05-10 22:57:40 UTC

Description Peter Rajnoha 2016-01-22 08:50:38 UTC
Currently, when devices/external_device_info_souce="udev" is configured, lvm2 uses udev database records to make a decision whether a disk contains partition table. Such disk is filtered out. LVM2 uses two variables coming from blkid scan within udev to decide on this:

  - ID_PART_TABLE_TYPE="<partition_table_type>"
  - ID_PART_ENTRY_DISK="major:minor"

The ID_PART_TABLE_TYPE is set for both whole disks as well as partitions while the ID_PART_ENTRY_DISK is set only for partitions (the major:minor is the major:minor of whole disk for this partition).

The filter looks whether ID_PART_TABLE_TYPE is the only one set and if yes, such device is filtered in lvm2 as we should prefere partitions over whole device.

The bug here is that the ID_PART_ENTRY_DISK blkid variable was introduce in addition later in util-linux v2.19. The version used in (current) RHEL6.7/RHEL6.8 is still v2.17.

This means the ID_PART_TABLE_TYPE is set for both whole device and partitions, but there's no ID_PART_ENTRY_DISK to see a difference between these two. We need to use some other variable that is available, if at all, to decide on this.

We can't make a difference by looking at the DEVTYPE variable only which is set to "disk" for whole device and "partition" for partitions, because device abstractions like DM (and MD possibly) have DEVTYPE variable set to "disk" all the time, no matter if it's whole device or partition (from pure device point of view, it's true, because partition on a DM device is just another DM device stacked on top of the other one from kernel point of view.

Fix this "partition check" by carefully selecting best set of variables which are available in udev db to make proper decision about whole devices and their partitions, even for device abstractions like DM.

If there's no such reliable set of variable in udev db to make this decision, switch the code to using it's own original scan instead (check for libbblkid version etc.).

Comment 2 Peter Rajnoha 2016-01-22 08:55:42 UTC
Note: the devices/external_device_info_souce="udev" is not used by default. But we should still fix this as it can cause incorrect devices to be filtered out when someone switches to this device info source.

Comment 3 Peter Rajnoha 2016-02-02 12:44:31 UTC
Fixed by this patch:

https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=ec43f55445966b5075fa8083921d182a0a138326

For example:

[root@rhel6-a ~]# lvmconfig devices/external_device_info_source
external_device_info_source="udev"

[root@rhel6-a ~]# lsblk
NAME                        MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
vda                         252:0    0   10G  0 disk  
|-vda1                      252:1    0  500M  0 part  /boot
`-vda2                      252:2    0  9.5G  0 part  
  |-VolGroup-lv_root (dm-0) 253:0    0  7.6G  0 lvm   /
  `-VolGroup-lv_swap (dm-1) 253:1    0    2G  0 lvm   [SWAP]
sda                           8:0    0    4G  0 disk  
`-sda1                        8:1    0    4G  0 part  
sdb                           8:16   0    4G  0 disk  
`-test (dm-3)               253:3    0   32M  0 dm    
  `-test1 (dm-4)            253:4    0 31.4M  0 part  
sdd                           8:48   0    4G  0 disk  
`-md127                       9:127  0    4G  0 raid1 
  `-md127p1                 259:0    0    4G  0 md    
sdc                           8:32   0    4G  0 disk  
`-md127                       9:127  0    4G  0 raid1 
  `-md127p1                 259:0    0    4G  0 md    
sde                           8:64   0    4G  0 disk 

Without this patch:

[root@rhel6-a ~]# pvs -vvvv &> log

[root@rhel6-a ~]# grep "Skipping: Partition table signature found" log
#filters/filter-partitioned.c:30         /dev/sda: Skipping: Partition table signature found [udev:0x7f2fcc806930]
#filters/filter-partitioned.c:30         /dev/vda: Skipping: Partition table signature found [udev:0x7f2fcc806930]
#filters/filter-partitioned.c:30         /dev/sda1: Skipping: Partition table signature found [udev:0x7f2fcba6f810]
#filters/filter-partitioned.c:30         /dev/vda1: Skipping: Partition table signature found [udev:0x7f2fcba6f810]
#filters/filter-partitioned.c:30         /dev/vda2: Skipping: Partition table signature found [udev:0x7f2fcc803500]
#filters/filter-partitioned.c:30         /dev/mapper/test: Skipping: Partition table signature found [udev:0x7f2fcc7fb190]
#filters/filter-partitioned.c:30         /dev/md127: Skipping: Partition table signature found [udev:0x7f2fcc805130]
#filters/filter-partitioned.c:30         /dev/mapper/test: Skipping: Partition table signature found [udev:0x7f2fcc805190]

With this patch applied:

[root@rhel6-a ~]# pvs -vvvv &> log

[root@rhel6-a ~]# grep "Skipping: Partition table signature found" log
#filters/filter-partitioned.c:30         /dev/sda: Skipping: Partition table signature found [udev:0x7f37342ef3b0]
#filters/filter-partitioned.c:30         /dev/vda: Skipping: Partition table signature found [udev:0x7f37342ef3b0]
#filters/filter-partitioned.c:30         /dev/mapper/test: Skipping: Partition table signature found [udev:0x7f373354e610]
#filters/filter-partitioned.c:30         /dev/md127: Skipping: Partition table signature found [udev:0x7f373354e640]
#filters/filter-partitioned.c:30         /dev/mapper/test: Skipping: Partition table signature found [udev:0x7f37342f16a0]


So the difference is that partitions are *not* filtered now. Only whole devices with partition tables on them should be filtered.

Comment 6 Roman Bednář 2016-02-29 12:06:31 UTC
Verified. Partitions are no longer filtered when 'external_device_info_souce="udev"' is used.

# lvmconfig devices/external_device_info_source
external_device_info_source="udev"

# lsblk
NAME                          MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
vda                           252:0    0  8.2G  0 disk  
├─vda1                        252:1    0  500M  0 part  /boot
└─vda2                        252:2    0  7.7G  0 part  
  ├─vg_virt274-lv_root (dm-0) 253:0    0  6.9G  0 lvm   /
  └─vg_virt274-lv_swap (dm-1) 253:1    0  840M  0 lvm   [SWAP]
sdb                             8:16   0   10G  0 disk  
└─md0                           9:0    0   10G  0 raid1 
  └─md0p1                     259:0    0   10G  0 md    
sda                             8:0    0   10G  0 disk  
sdc                             8:32   0   10G  0 disk  
└─md0                           9:0    0   10G  0 raid1 
  └─md0p1                     259:0    0   10G  0 md 
   
# pvs -vvvv &> log

# grep "Skipping: Partition table signature found" log
#filters/filter-partitioned.c:27         /dev/md0: Skipping: Partition table signature found
#filters/filter-partitioned.c:27         /dev/vda: Skipping: Partition table signature found


Tested on:
2.6.32-616.el6.x86_64

lvm2-2.02.141-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
lvm2-libs-2.02.141-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
lvm2-cluster-2.02.141-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
udev-147-2.71.el6    BUILT: Wed Feb 10 14:07:17 CET 2016
device-mapper-1.02.115-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
device-mapper-libs-1.02.115-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
device-mapper-event-1.02.115-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
device-mapper-event-libs-1.02.115-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016
device-mapper-persistent-data-0.6.2-0.1.rc1.el6    BUILT: Wed Feb 10 16:52:15 CET 2016
cmirror-2.02.141-2.el6    BUILT: Wed Feb 10 14:49:03 CET 2016

Comment 8 errata-xmlrpc 2016-05-11 01:20:29 UTC
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-0964.html


Note You need to log in before you can comment on or make changes to this bug.