Ubuntu

dm-part-sync.patch breaks creating multiple partitions on a LVM volume

Reported by Ludovico Cavedon on 2012-06-14
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
parted (Ubuntu)
High
Canonical Foundations Team
Precise
High
Canonical Foundations Team
Quantal
High
Canonical Foundations Team

Bug Description

[IMPACT]

The patch dm-part-sync.patch, added during the precise development cycle, caused a regression wherein users are unable to use parted to manipulate partitions contained within an LVM logical volume under either of two conditions:

1) You specify the "disk" using the /dev/VG/LV symlink rather than /dev/mapper/vg-lv

2) There is more than one partition within the "disk"

In addition to LVM, this should also apply to dmraid disks.

The first problem is fixed by looking up the canonical /dev/mapper/ device name of the disk, and using that as the base name when building the names of the partition devices. The second problem is fixed by assuming that dm disks can hold MAX_NUM_PARTS partitions, rather than looking up what the kernel reports in the sysfs ext_range attribute, which is just one.

[TESTCASE]

# lvcreate -n test -L 10M matrix
  Rounding up size to full physical extent 12.00 MiB
  Logical volume "test" created
# parted --script -- /dev/matrix/test mklabel msdos
# parted --script -- /dev/matrix/test mkpart primary ext4 1 2
# parted --script -- /dev/matrix/test mkpart primary ext4 3 4
device-mapper: create ioctl failed: Device or resource busy
Error: Failed to add partition 1 (No such device or address)
# ls /dev/mapper/matrix-test*
/dev/mapper/matrix-test
/dev/mapper/matrix-test1

[Regression Potential]

The changes are unlikely to impact anything other than using parted on dm devices, which is essentially broken in its current state.

apport information

tags: added: apport-collected precise
description: updated
summary: - dm-part-sync.patch breaks creating multiple partition on a LVM volume
+ dm-part-sync.patch breaks creating multiple partitions on a LVM volume
Phillip Susi (psusi) wrote :

Hrm... I notice that the partition symlinks are not being created under /dev/vg, and using /dev/mapper/vg-lv instead of /dev/vg/lv works fine. It looks like the missing symlink may be a separate bug and parted should always use the canonical name ( /dev/mapper/vg-lv ) no matter what name is specified on the command line.

Phillip Susi (psusi) wrote :

It also seems that there was another problem with the patch: it would only add at most 1 partition to a dm disk. That's a release regression and going to need an SRU.

Changed in parted (Ubuntu):
importance: Undecided → High
status: New → In Progress
tags: added: regression-release
Micah Gersten (micahg) on 2012-06-26
tags: added: rls-q-incoming
tags: added: quantal
Phillip Susi (psusi) on 2012-06-26
Changed in parted (Ubuntu Precise):
status: New → In Progress
importance: Undecided → High
Phillip Susi (psusi) on 2012-06-26
Changed in parted (Ubuntu Precise):
milestone: none → ubuntu-12.04.1
Changed in parted (Ubuntu Quantal):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
tags: removed: rls-q-incoming
Stéphane Graber (stgraber) wrote :

Sounds like a bug for Colin or Dmitrijs, could one of you review the branches?

Assuming they are good, we should have enough time to actually land this in 12.04.1.

Changed in parted (Ubuntu Precise):
status: In Progress → Triaged
status: Triaged → In Progress
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Martin Pitt (pitti) wrote :

Phillip, is there an upstream bug for this somewhere? Can you please forward this to upstream as well? Thanks!

Phillip Susi (psusi) wrote :

It's a bug in our patch, not upstream. I had forwarded the patch upstream, but it was never applied. I'll have to update the patch and resend it.

Dimitri John Ledkov (xnox) wrote :

When running the test case as described in the bug description, with the fixed package by psusi, I go this:

$ sudo parted --script -- /dev/internalhdd/test mkpart primary ext4 3 4
Error: You requested a partition from 3000kB to 4000kB.
The closest location we can manage is 4194kB to 4194kB.

Changing to create the second partition further down, succeeds.

Phillip Susi, can you please use the https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template template and adjust the bug description suitable for an SRU ?

Phillip Susi (psusi) on 2012-07-17
description: updated
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package parted - 2.3-10ubuntu2

---------------
parted (2.3-10ubuntu2) quantal; urgency=low

  * Fix dm-part-sync.patch to canonicalize the dm name when constructing
    the partition device path (LP: #1012946)
 -- Phillip Susi <email address hidden> Tue, 17 Jul 2012 15:50:56 +0100

Changed in parted (Ubuntu Quantal):
status: In Progress → Fix Released
Bryce Harrington (bryce) on 2012-07-19
Changed in parted (Ubuntu Precise):
status: In Progress → Fix Committed

Bryce, has this been actually uploaded and accepted into precise-proposed? If not, the precise task should not be Fix Committed.

Stéphane Graber (stgraber) wrote :

Parted is in Unapproved, marking In Progress for now, should automatically be marked Fix commited in a few days.

Changed in parted (Ubuntu Precise):
status: Fix Committed → In Progress

Hello Ludovico, or anyone else affected,

Accepted parted into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/parted/2.3-8ubuntu5.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in parted (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in parted (Ubuntu Precise):
milestone: ubuntu-12.04.1 → ubuntu-12.04.2
lhotari (lartsa) wrote :

This bug also affects the usage of raw partitions in vmbuilder.

Dimitri John Ledkov (xnox) wrote :

@lartsa there is no need to confirm the bug. It is fix released in quantal. Please help test the proposed update for precise following these instructions: https://bugs.launchpad.net/ubuntu/+source/parted/+bug/1012946/comments/11

lhotari (lartsa) wrote :

Installing the precise-proposed version from https://launchpad.net/ubuntu/precise/+package/libparted0debian1 (2.3-8ubuntu5.1) fixes the problems in vmbuilder.

Phillip Susi (psusi) on 2012-10-16
tags: added: verification-done
removed: verification-needed

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package parted - 2.3-8ubuntu5.1

---------------
parted (2.3-8ubuntu5.1) precise-proposed; urgency=low

  * Fix dm-part-sync.patch to canonicalize the dm name when constructing
    the partition device path (LP: #1012946)
 -- Phillip Susi <email address hidden> Sat, 16 Jun 2012 21:26:34 -0400

Changed in parted (Ubuntu Precise):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers