Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I tried to delete a LV today and got the following message:
WARNING: Not using lvmetad because duplicate PVs were found.
WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
WARNING: PV uJxvY9-ZhWW-cDEi-0eay-LFNl-jFBM-q5ewpR on /dev/mapper/VM-WebServer2 was already found on /dev/mapper/VM-Owncloud2.
WARNING: PV uJxvY9-ZhWW-cDEi-0eay-LFNl-jFBM-q5ewpR prefers device /dev/mapper/VM-Owncloud2 because device is used by LV.
Logical volume VM/LDAP is used by another device.
Not sure where to start. When I run vgscan and pvscan they each indicate duplicates. Also when I view /dev/mapper it displays multiple entries for the same LV (ie VM-owncloud, VM-owncloud1, VM-owncloud2).
When I run pvdisplay it will indicate that there are several Physical Volumes on a Volume Group that weren't created in that volume group. Example:
--- Physical volume ---
PV Name /dev/mapper/VM-LDAP2
VG Name centos
PV Size 24.51 GiB / not usable 3.00 MiB
Allocatable NO
PE Size 4.00 MiB
Total PE 6274
Free PE 11
Allocated PE 6263
PV UUID 7L2ic8-ll1Z-UKCi-92Ru-8CRu-fa9G-P9ciCJ
--- Logical volume ---
LV Path /dev/VM/LDAP
LV Name LDAP
VG Name VM
LV UUID OL0Ind-b0Bq-Df4Y-yLl5-PrQA-ox4Y-RH7JbY
LV Write Access read/write
LV Creation host, time server.usable-home.com, 2016-10-27 08:15:15 -0600
LV Status available
# open 2
LV Size 25.00 GiB
Current LE 6400
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:17
So I created the LV "LDAP" on VM but there is an entry (/dev/mapper/VM-LDAP2) that appears on the volume group "centos".
I am guessing from reading other forums and docs that it has something to do with the filter settings in lvm.conf (I have not changed the standard config file). I am using CentOS7, but haven't figured out what the proper filter should be.
That might or might not be straightforward to clean up. You've got duplicate UUIDs. That's usually caused by using dd or similar tools to clone a disk or partition. Let's start by looking at the output from "lsblk -f" (run as root), and then try to determine what is where and what you want to keep. Changing a UUID is easy. Doing that without breaking whatever might be referencing that UUID can be hard.
If you run "ls -l /dev/mapper/VM-LDAP2" what does it show? Similarly if you run "ls -l /dev/mapper/VM-Owncloud2" what does that show? If they are links to dm* devices what do details of those dm devices show.
I'm used to seeing devices here created by multipathd. Running "multipath -l VM-LDAP2" will show you details of that if it is a multipath device including the underlying sd* devices (which are in /dev/sd*) that comprise it. Similarly "multipath -l VM-Owncloud2" would show details of that. I suspect you have separate underlying sd* devices for both.
When I had a similar issue some time back I had to set the lvm.conf mirror to simply allow the devices I did want so it excluded those. (This occurred because I'd done back end disk array mirroring and the server had access to both the old and the new devices.)
The default filter for that (RHEL6) had been:
# Default filter:
filter = [ "a/.*/" ]
I modified it to only find the devices I wanted:
# Modified filter:
filter = [ "a|/dev/sda2|", "a|/dev/mapper/hldevc.*|", "r|.*|" ]
In my case I'd wanted to include any /dev/mapper/device starting with "hldevc" (excluding for example hldev2*, hldeve*).
You should be able to create a filter like the above that only allows the ones you want and excludes all others (which is what the r|... is doing) to include EITHER /dev/mapper/VM-Owncloud2 OR /dev/mapper/VM-LDAP2 but not both. Don't forget to include anything else that should be there (e.g. in mine sda2 was the internal disk on which my LVM for root and other filesystems existed).
Sorry about the delay -- missed your post somehow. Please wrap data like that in [CODE] ... [/CODE] tags to preserve formatting. Fortunately, by quoting your post I am able to recover the formatting.
Not that I understand it, though. It looks like you somehow have LVM-2 PVs nested inside the sda4 PV. I see an LV "VM-WebServer" which is, what, a partitioned disk image, perhaps, with partition 1 being an ext4 filesystem and partition 2 being an LVM PV which does not (yet) have anything inside it?? OK, that seems to make sense, though I've never done that.
The duplicate UUIDs for VM-WebServer[12] and VM-Owncloud[12] are apparent. Since VM-WebServer2 appears to be unused (no LVs in it), you can perhaps run "pvchange --uuid /dev/VM/WebServer2" to get a new, random UUID assigned. You should probably also change the UUID on the ext4 filesystem in VM-WebServer1, "tune2fs -U random /dev/VM/WebServer1", though that might require also updating whatever /etc/fstab references that UUID. I'm making a lot of guesses in unfamiliar territory here, so I don't have a lot of faith in these answers.
Interestingly enough, I restarted the server this morning (which I have done several times), after trying to resolve the duplicate UUID (which failed because of a 'duplicate PV' message). After the restart I ran the 'lsblk -f' and everything seems to have 'somehow' resolved itself:
That is how everything 'should' appear. I have never created any other PV's inside of sda other than 1-4. Not sure what happened, but thanks for your help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.