This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 622526 - duplicate vg name precedence logic can be wrong
duplicate vg name precedence logic can be wrong
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
17
All Linux
low Severity medium
: ---
: ---
Assigned To: LVM and device-mapper development team
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-08-09 11:54 EDT by Need Real Name
Modified: 2013-08-01 12:38 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-01 12:38:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2010-08-09 11:54:27 EDT
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 12:11:47 EDT
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 12:23:39 EDT
"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 12:34:38 EDT
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 14:51:17 EDT
Re-opening since I don't think this bug is gone.
Comment 5 Alasdair Kergon 2010-10-22 08:02:53 EDT
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 10:55:51 EDT
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 16:47:08 EDT
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 07:48:38 EDT
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 01:30:33 EDT
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 12:38:48 EDT
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.