Bug 858704 - partprobe generates incorrect DM UUIDs for partitions created on top of DM devices
Summary: partprobe generates incorrect DM UUIDs for partitions created on top of DM de...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: parted
Version: 18
Hardware: All
OS: Linux
high
high
Target Milestone: ---
Assignee: Brian Lane
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-19 13:14 UTC by Peter Rajnoha
Modified: 2012-12-20 15:31 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-20 15:31:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Peter Rajnoha 2012-09-19 13:14:11 UTC
When there are partitions defined on top of a device-mapper device (either a bare device-mapper device or any device-mapper subsystem like LVM or multipath), calling partprobe on such a device causes the original DM UUID to be reused for mappings representing partitions this way:

  <original_dm_uuid>p<partition_number>

This is not very suitable as each subsystem uses its own prefix for DM UUID, for example "LVM-" prefix for LVM devices, "mpath-" for multipath devices, "CRYPT-LUKS1-" for LUKS devices using cryptsetup etc.

Using the same DM UUID prefix for mappings representing partitions can cause problems when identifying these devices, for example lsblk then incorrectly identifies the partition mapping as an LVM device if partitions are defined over an LVM device:

rawhide/~ # partprobe /dev/vg_test/lvol0

rawhide/~ # dmsetup info -c -o name,uuid
Name            UUID                                                                  
vg_test-lvol0p1  LVM-uMhMAV4UYSX8yUhYKoiquxOsMQsX24GkCyKytUdEYXK5uexWROeJvH4O4NmpfCjLp1
vg_test-lvol0    LVM-uMhMAV4UYSX8yUhYKoiquxOsMQsX24GkCyKytUdEYXK5uexWROeJvH4O4NmpfCjL  

rawhide/~ # lsblk -o name,type /dev/vg_test/lvol0  
NAME                     TYPE
vg_test-lvol0 (dm-0)     lvm
`-vg_test-lvol0p1 (dm-1) lvm

...as lsblk derives the exact device type from DM UUID if it's a device-mapper device. This could pose problems in udev rules as well as most of the rules are taking into account DM UUID to resolve the subsystem type used (triggering different parts of the rules).


I suggest using the same scheme as kpartx uses nowadays:

rawhide/~ # kpartx -a /dev/mapper/vg_test-lvol0

rawhide/~ # lsblk -o name,type /dev/vg_test/lvol0
NAME                     TYPE
vg_test-lvol0 (dm-0)     lvm
`-vg_test-lvol0p1 (dm-1) part

rawhide/~ # dmsetup info -c -o name,uuid
Name             UUID                                                                      
vg_test-lvol0p1  part1-LVM-uMhMAV4UYSX8yUhYKoiquxOsMQsX24GkCyKytUdEYXK5uexWROeJvH4O4NmpfCjL
vg_test-lvol0    LVM-uMhMAV4UYSX8yUhYKoiquxOsMQsX24GkCyKytUdEYXK5uexWROeJvH4O4NmpfCjL      

rawhide/~ # lsblk -o name,type /dev/vg_test/lvol0
NAME                     TYPE
vg_test-lvol0 (dm-0)     lvm
`-vg_test-lvol0p1 (dm-1) part

Which means using a "partition prefix" instead of suffix in DM UUIDs. Such scheme does not pose any problems for device identification.

Comment 1 Peter Rajnoha 2012-09-19 14:03:33 UTC
Appears in current rawhide (parted-3.1-7.fc19) as well as F18 alpha (parted-3.1-7.fc18). Problem does not appear in F17 (parted-3.0-10.fc17) as UUIDs are not copied and they remain blank for partition mappings. There's still time to include this in F18.

Comment 2 Fedora Update System 2012-10-17 00:12:19 UTC
parted-3.1-8.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/parted-3.1-8.fc18

Comment 3 Fedora Update System 2012-10-17 03:18:23 UTC
Package parted-3.1-8.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing parted-3.1-8.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-16288/parted-3.1-8.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-12-20 15:31:36 UTC
parted-3.1-8.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.


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