Installing to HDD with previous ubuntu fails to create fresh LVM claiming group already in use

Bug #154086 reported by cpitchford
98
This bug affects 13 people
Affects Status Importance Assigned to Milestone
partman-auto-lvm (Debian)
New
Unknown
partman-auto-lvm (Ubuntu)
Fix Released
High
Unassigned
Precise
Fix Released
Medium
Unassigned
Quantal
Fix Released
High
Unassigned
partman-lvm (Ubuntu)
Won't Fix
Medium
Dimitri John Ledkov

Bug Description

[IMPACT]

 * Fail to pre-seed automatic LVM installation on machines with:
- empty / new partition table
- not-zeroed out disks
- which had the same partition layout
- and the same volume group names

 * this affects large scale automated installs / deployments, as it is very easy to get all of those conditions when reinstalling.

 * To fix this bug partman-auto-lvm should be updated with the proposed fix
 * the fixed partman-auto-lvm should also make it onto affected images

[TESTCASE]

 * Pre-seed or manually execute "Guided partitioning - LVM"
 * Remove/Clear partition table with e.g.:

# fdisk /dev/vda << EOF
o
w
EOF

 * Pre-seed or manually execute "Guided partitioning - LVM" again

[Regression Potential]

 * while the current behaviour is broken, it did allow to "resurrect" LVM groups by bailing out the install after the zombie VGs groups became detected, but it is not guaranteed that the resurrected VGs are correct: the partition can be too small and VG can be incomplete (only 1 out of many physical volumes). Some people may have been relying on this. The correct behaviour will attempt to delete the zombie VGs by asking a question that can be pre-seeded or manually backed out of.

Revision history for this message
cpitchford (ubuntu-intrepid) wrote :

Switching to an alternate console (alt-f2) and using fdisk to delete the partition table meant I could carry on and create a new LVM instance, but I couldn't see a simple (or even complex) way to do this from the menu

Revision history for this message
Andrew Fuchs (fuchs.andy) wrote :

I'm having the same problem with the final 7.10 server i386 install cd. When I select "Guided - Use entire disk and setup LVM", it returns the same error.

Revision history for this message
Lars Uhlmann (ubuntu-lars-uhlmann) wrote :

Same problem here. The s-ata harddisk had a Debian "etch" with lvm installed before. To figure that out I booted Knoppix and erased the partition table with 'dd if=/dev/zero of=/dev/sda bs=1M count=1'. Nevertheless I'm still unable to use "Guided - Use entire disk and setup LVM".
I'm installing via PXE, kernel and initrd are taken from "ubuntu-7.10-server-amd64.iso".
Could at least someone use the automated lvm setup w/o problems?

Colin Watson (cjwatson)
Changed in debian-installer:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Colin Watson (cjwatson) wrote :

I think this should be a lot better in Hardy, but I'd appreciate testing. (In a manual install it ought to ask you whether you want to remove the volumes; in an automatic install you would need to preseed 'd-i partman-lvm/device_remove_lvm boolean true'.)

Revision history for this message
Match (xhosa) wrote :

I'm seeing this bug on Karmic (9.10) Server automatic (preseed) builds.

My preseed file contains:

d-i partman-lvm/device_remove_lvm boolean true
d-i partman-lvm/confirm boolean true

If I reboot the box and start a server install, it stops with 'Volume Group name already in use"

If I reboot at this point, and restart the build it continues without interruption.

Revision history for this message
Joel Ebel (jbebel) wrote :

Colin, adding partman-lvm/device_remove_lvm doesn't take care of this case:

1. Begin an install with LVM auto partitioning. Let the partitioning step finish.
2. Delete the partition table
3. Start another install and select LVM auto partitioning.

You get an error that the volume group name is already in use. If you continue and try again, then it works. My understanding is that even if you preseed every option available to remove existing LVM data, if LVM data suddenly appears when the disk gets partitioned, partman is incapable of removing it. If you select continue, it restarts the partitioning step and allow the removal of the existing data since the partitions now exist.

tags: added: glucid
Revision history for this message
Peter Matulis (petermatulis) wrote :

I've also hit this ('partman-lvm/device_remove_lvm' not having effect). However, it doesn't manifest itself on KVM guests.

Revision history for this message
Peter Matulis (petermatulis) wrote :

┌──────────────────────┤ [!!] Partition disks ├───────────────────────┐
│ │
│ Volume group name already in use │
│ The volume group name used to automatically partition using LVM is │
│ already in use. Lowering the priority for configuration questions │
│ will allow you to specify an alternative name. │
│ │
│ <Go Back> <Continue> │
│ │
└──────────────────────────────────────────────────────────┘

Preseed file, and syslog/partman install files (using DEBCONF_DEBUG=developer installer kernel option) to be attached shortly.

Revision history for this message
Peter Matulis (petermatulis) wrote :
Revision history for this message
Peter Matulis (petermatulis) wrote :
Revision history for this message
Peter Matulis (petermatulis) wrote :
Revision history for this message
Philip Hands (phil-hands) wrote :

The cause of this (assuming that it's the same bug as I've been tracking in Debian Squeeze) is that the LVM data is on the disk, but the partitions are not, so when it tries to look for pre-existing PVs it finds none. Then it sets up the partitions, and assuming the partitions are created in the same place, the partitions that are created are then revealed to contain the previous LVM data, which throws a spanner in the works.

As a work around, I've modified /lib/partman/lib/auto-lvm.sh, just below thse lines:

  open_dialog COMMIT
  close_dialog

adding:

  sleep 10
  pvs --all > /dev/null
  device_remove_lvm $dev

The sleep is to allow things to settle after the partitions are created by the COMMIT. This should really be detecting when the partitions are ready, rather than just pausing for a while.

The 'pvs --all' seems to kick pvs such that it then lists the information we need -- without that it reacts as though the PVs are not there.

and then we can remove the lvm info from the device.

With that change the install works for me.

tags: added: rls-mgr-l-tracking
Revision history for this message
Chris J Arges (arges) wrote :

Just tested this with a daily precise server iso:
http://cdimage.ubuntu.com/releases/precise/alpha-1/

Installed and used "Guided - Use entire disk and setup LVM". Then installed again using "Guided - Use entire disk and setup LVM".
The installer allowed me to write over the existing LVM and warned me about it.

I was wondering if I'm not reproducing correctly. Can somebody else verify this with the current iso?

Thanks,
--chris

Revision history for this message
Peter Matulis (petermatulis) wrote :

I just tested with Ubuntu 11.04 on both bare metal and on a KVM guest and I cannot reproduce the problem. I was using preseed. I'll test on Ubuntu 11.10 tomorrow.

Revision history for this message
Peter Matulis (petermatulis) wrote :

I have finally reproduced this with a HP SmartArray P400 (v.4.06) RAID controller. The preseed server is running Ubuntu 11.04 and I attempted to install Ubuntu 11.04.

Revision history for this message
Peter Matulis (petermatulis) wrote :

I have implemented the workaround from comment #12 by replacing auto-lvm.sh during install time via an early-command script.

Changed in partman-auto-lvm (Ubuntu Precise):
status: New → Confirmed
Changed in partman-auto-lvm (Ubuntu Quantal):
assignee: nobody → Dmitrijs Ledkovs (dmitrij.ledkov)
Changed in partman-auto-lvm (Ubuntu Precise):
assignee: nobody → Dmitrijs Ledkovs (dmitrij.ledkov)
Changed in partman-auto-lvm (Ubuntu Quantal):
importance: Medium → High
Changed in partman-auto-lvm (Ubuntu Precise):
importance: Undecided → Medium
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Recreated in quantal ubuntu-server install (2012-09-01 image) using the whole disk-partition as lvm option, on a disk with a previous
u-server install.

Dave

Changed in partman-auto-lvm (Ubuntu Precise):
milestone: none → ubuntu-12.04.2
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@Peter Matulis (petermatulis):
A small note in the pre seed file, you probably want to add:
d-i partman-lvm/confirm_nooverwrite boolean true

It's not a fix for this bug, just a comment.

Changed in partman-lvm (Ubuntu Precise):
status: New → Confirmed
Changed in partman-lvm (Ubuntu Quantal):
status: New → Confirmed
Changed in partman-lvm (Ubuntu Precise):
importance: Undecided → Medium
Changed in partman-lvm (Ubuntu Quantal):
importance: Undecided → High
Changed in partman-lvm (Ubuntu Precise):
assignee: nobody → Dmitrijs Ledkovs (xnox)
Changed in partman-lvm (Ubuntu Quantal):
assignee: nobody → Dmitrijs Ledkovs (xnox)
Changed in partman-auto-lvm (Ubuntu Precise):
status: Confirmed → Invalid
Changed in partman-auto-lvm (Ubuntu Quantal):
status: Confirmed → Invalid
Changed in partman-auto-lvm (Ubuntu Precise):
assignee: Dmitrijs Ledkovs (xnox) → nobody
Changed in partman-auto-lvm (Ubuntu Quantal):
assignee: Dmitrijs Ledkovs (xnox) → nobody
Changed in partman-auto-lvm (Ubuntu Precise):
milestone: ubuntu-12.04.2 → none
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Upon calling create Volume Group a few checks are done.
One of the check is Volume Group name collision.
This could be valid (duplicate name, pre-seed mistake, etc) or it could be a "zombie" Volume Group that got detected on otherwise empty partition.
There is a codepath to remove existing volume groups with confirmation.
I think instead claiming name collision, we should take that path:
- it can be pre-seeded out
- user can proceed to remove "zombie"/name-conflict or back out to partitioning

I will try to patch this & test it.

Does this sound reasonable?

Changed in partman-lvm (Ubuntu Quantal):
status: Confirmed → In Progress
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

While the bug is displayed in partman-auto-lvm, I believe it could be also reproduced in the manual partitioning.
Also I'd rather fix the bug where it happens, instead of working around it higher up in the auto partitioning.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@ Philip Hands (phil-hands)

I decided to take a variation of your patch, with following changes:
* call update-dev --settle, instead of doing waits
* call vgdisplay to give LVM a kick (same as partman-lvm/init.d/ does)
* and call device_remove_lvm loop in a separate loop, in case creating partitions fails for some reason

I will attach a patch here for testing in a moment.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Changed in partman-auto-lvm (Ubuntu Quantal):
status: Invalid → Fix Committed
Changed in partman-auto-lvm (Ubuntu Precise):
status: Invalid → In Progress
Changed in partman-lvm (Ubuntu Quantal):
importance: High → Medium
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

I wonder if this affects manual partitioning as well, if the user recreates the same partitioning table. But I am not too sure if there is a way for me to hook into create partition / commit.

I will play around with it and see what I can come up with.

tags: added: patch
Changed in partman-lvm (Debian):
status: Unknown → New
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

During manual partitioning, if you managed to get the partition table exactly right, upon creating the volume group you are thrown back into logical volume setup dialog, but this time around it will show the "resurrected" LVMs. And you can proceed to delete them or do as you please.

no longer affects: partman-lvm (Ubuntu Quantal)
no longer affects: partman-lvm (Ubuntu Precise)
Changed in partman-lvm (Ubuntu):
status: In Progress → Won't Fix
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-auto-lvm - 45ubuntu3

---------------
partman-auto-lvm (45ubuntu3) quantal; urgency=low

  * After creating partitions, wait for devices to settle and wipe
    left-over LVM from them. (Closes: #542441) (LP: #154086)
 -- Dmitrijs Ledkovs <email address hidden> Mon, 10 Sep 2012 13:05:06 +0100

Changed in partman-auto-lvm (Ubuntu Quantal):
status: Fix Committed → Fix Released
Changed in partman-auto-lvm (Debian):
status: Unknown → New
Revision history for this message
Peter Matulis (petermatulis) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Thank you Peter. I will prepare an SRU for precise as well.

Changed in partman-auto-lvm (Ubuntu Precise):
assignee: nobody → Dmitrijs Ledkovs (xnox)
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Precise SRU is uploaded and is currently pending approval in the unapproved queue.

Changed in partman-auto-lvm (Ubuntu Precise):
assignee: Dmitrijs Ledkovs (xnox) → nobody
no longer affects: partman-lvm (Debian)
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello cpitchford, or anyone else affected,

Accepted partman-auto-lvm into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/partman-auto-lvm/42ubuntu2.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 partman-auto-lvm (Ubuntu Precise):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Peter Matulis (petermatulis) wrote :

This looks good to me.

== Test method ==

I used

http://archive.ubuntu.com/ubuntu/dists/precise-updates/main/installer-amd64/current/images/netboot/netboot.tar.gz

and

APPEND initrd=ubuntu-installer/amd64/initrd.gz priority=critical locale=en_US interface=eth0 url=http://10.153.107.1/preseed.txt DEBCONF_DEBUG=developer apt-setup/proposed=true

Then, with an existing install on-disk, I rebooted, removed the array, redid the same array, and installed successfully.

After that, I removed 'apt-setup/proposed=true', rebooted, removed the array, redid the same array, and eventually got the error:

"Volume group name already in use"

I would say that the proposed Precise fix has been verified.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package partman-auto-lvm - 42ubuntu2.1

---------------
partman-auto-lvm (42ubuntu2.1) precise-proposed; urgency=low

  * After creating partitions, wait for devices to settle and wipe
    left-over LVM from them. (Closes: #542441) (LP: #154086)
 -- Dmitrijs Ledkovs <email address hidden> Mon, 10 Sep 2012 13:05:06 +0100

Changed in partman-auto-lvm (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Ivan Grafutko (ivan-grafutko) wrote :

manual fix - in partion disks go to configure lvm > click yes > delete partions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.