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:
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.
"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.)
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?
Re-opening since I don't think this bug is gone.
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.
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.
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!
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
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.
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.