Bug 622526 - duplicate vg name precedence logic can be wrong
Summary: duplicate vg name precedence logic can be wrong
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: lvm2
Version: 17
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: LVM and device-mapper development team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-08-09 15:54 UTC by Need Real Name
Modified: 2013-08-01 16:38 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-08-01 16:38:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2010-08-09 15:54:27 UTC
Description of problem:
Hard drive starts to die. Swap out old drive, replace with new drive, reinstall.

Steps to Reproduce:
Mount old drive using external housing. Try to mount, get error about duplicate VG name.
 "WARNING: Duplicate VG name vg_HOST: OLD-UID (created here) takes precedence over NEW-UID"
  
Actual results:
 LVM tries to assign vg_HOST to the old drive (OLD-UID)

Expected results:
 LVM should do something else: refuse because the disk is mounted? refuse because the root partition is using it?


Additional info:

Comment 1 Need Real Name 2010-08-09 16:11:47 UTC
Actually the "created here" logic is wrong. For me, it choose the VG that was created with a different install of Fedora. Yes, the hardware was the same in both cases.

Comment 2 Milan Broz 2010-08-09 16:23:39 UTC
"create here" is just comment.

You basically cannot use two VGs with the same name. You can use VG UUID to some subsets of commands - but mainly just to fix the situation (like to rename old VG).
See "man vgrename" for example how to use VG UUID here.

Otherwise you have to use lvm filter (in lvm.conf) to filter out devices with old VG. So LVM will just operate with devices containing new VG.

Another alternative is mark old VG as exported (but it is probably not what you want - see vgexport/vgimport).

(I suggest to rename old VG to some different name.)

Comment 3 Need Real Name 2010-08-09 16:34:38 UTC
Not being allowed to use two vgs with the same name is fine, but from what you wrote I think the warning sounds like it means something else.

"WARNING: Duplicate VG name vg_HOST: OLD-UID (created here) takes precedence
over NEW-UID"

The way I read this is: there are two vgs here with the same name. I'm going to pick one of them to win, and the other one will lose.

Is this wrong? How should it be read?

Comment 4 Need Real Name 2010-08-11 18:51:17 UTC
Re-opening since I don't think this bug is gone.

Comment 5 Alasdair Kergon 2010-10-22 12:02:53 UTC
For whatever reason, one had your hostname inside it while the other didn't, so it gave precedence to the one with your hostname.  The hostname is stored when the VG is created.

LVM requires VG names to be unique on a system - when they aren't it tries to do the right thing but it can never get it right 100% of the time.  It gives you a WARNING and expects you to deal with it if it made the wrong decision.

Comment 6 Need Real Name 2010-10-22 14:55:51 UTC
Yes, that's why I filed this bug: precedence should be given over a VG that is already mounted, and even moreso when it is the root filesystem.

Comment 7 Alasdair Kergon 2010-10-22 20:47:08 UTC
That could be a relatively expensive check to perform (1 ioctl per active dm device, or extending the current list-of-names ioctl to provide list-of-uuids) - basically to list the uuid of every active dm device and see if any start with either LVM-<vg_uuid>.  But it's worth considering, yes.

That check would need adding to _insert_vginfo():

                 * If   Primary not exported, new exported => keep
                 * Else Primary exported, new not exported => change
Add new "uuid is already in use on this machine" test here
                 * Else Primary has hostname for this machine => keep
                 * Else Primary has no hostname, new has one => change
                 * Else New has hostname for this machine => change
                 * Else Keep primary.

But these situations do not occur if people set up and use their systems correctly, so it doesn't matter how slow things get in cases when they don't.

It could be done through the existing libdevmapper API (or we might extend it a little).

But such a change would be a very low priority for us.  If you (or anyone else reading this) wishes to submit a patch for it, feel free to do so!

Comment 8 Bug Zapper 2011-06-01 11:48:38 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Fedora End Of Life 2013-07-04 05:30:33 UTC
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 10 Fedora End Of Life 2013-08-01 16:38:48 UTC
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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