LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-13-2017, 11:28 AM   #1
scottthepotter
LQ Newbie
 
Registered: Jan 2017
Location: Erie, CO
Distribution: CentOS, Debian
Posts: 3

Rep: Reputation: Disabled
LVM Duplicate PV's


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.

Any help/ideas?
 
Old 01-13-2017, 01:14 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
2 members found this post helpful.
Old 01-13-2017, 01:24 PM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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).
 
Old 01-13-2017, 01:32 PM   #4
scottthepotter
LQ Newbie
 
Registered: Jan 2017
Location: Erie, CO
Distribution: CentOS, Debian
Posts: 3

Original Poster
Rep: Reputation: Disabled
lsblk -f

NAME FSTYPE LABEL UUID MOUNTPOINT
sda
+-sda1
+-sda2 ext4 b47ad709-7459-4dc0-bd1f-96a305f8fcc1 /boot
+-sda3 LVM2_member Hf3WiB-S2eg-HdQe-vh9M-ssKT-Orzw-DTeegm
¦ +-centos-swap swap 5582427b-f280-4d59-8d39-e5e36fb860f1 [SWAP]
¦ +-centos-root ext4 31af4470-75ad-43a1-b810-0af43a1f84d8 /
¦ +-centos-home ext4 870b47a7-2101-4cb8-8636-f76946b48b06 /home
+-sda4 LVM2_member y0pytF-qOS3-vMuP-pO01-tf1d-SQZP-lLns0A
+-VM-WebServer
¦ +-VM-WebServer1 ext4 e893d43b-19ff-4dd9-a5b1-9896d2a10656
¦ +-VM-WebServer2 LVM2_member uJxvY9-ZhWW-cDEi-0eay-LFNl-jFBM-q5ewpR
+-VM-Asterisk
¦ +-VM-Asterisk2 ext4 a677c80f-45e8-4f06-b1ad-94167c839872
¦ +-VM-Asterisk1 ext4 25d540bc-7bc3-4a2b-b0f7-2fdbffd99171
¦ +-VM-Asterisk3 swap 80ca2f8e-6ce7-4172-ac8b-338f627e49d5
+-VM-Owncloud
¦ +-VM-Owncloud1 ext4 e893d43b-19ff-4dd9-a5b1-9896d2a10656
¦ +-VM-Owncloud2 LVM2_member uJxvY9-ZhWW-cDEi-0eay-LFNl-jFBM-q5ewpR
¦ +-VolGroup-lv_root ext4 6dc09a27-5a88-46df-ab2b-38eb1f9461d1
¦ +-VolGroup-lv_swap swap 86c80428-5bcc-4c02-a67c-cb5daa3eeedf
+-VM-Win2008
¦ +-VM-Win2008p1 ntfs 00FC7DEAFC7DDA7C
+-VM-Win7
¦ +-VM-Win7p1 ntfs System Reserved C0A48F28A48F2050
¦ +-VM-Win7p2 ntfs EE0494330493FCB1
+-VM-PlayOn
¦ +-VM-PlayOn1 ntfs System Reserved C0A48F28A48F2050
¦ +-VM-PlayOn2 ntfs EE0494330493FCB1
+-VM-Samba--Share
¦ +-VM-Samba--Share1 ext4 a86c2349-5828-4e55-9d52-3d986a62b0bc
+-VM-Webserver--Backup--Data
¦ +-VM-Webserver--Backup--Data1 ext4 619032ae-01a3-405d-856f-927ea76c0f9d
+-VM-Webserver--Backup
¦ +-VM-Webserver--Backup1 ext4 db82b982-8364-4d59-9d1f-7e1a48db0271
¦ +-VM-Webserver--Backup2 LVM2_member AzJf3s-wH3r-7VCk-Lvfo-xW6d-n0lJ-eETLqU
+-VM-FreePBX
¦ +-VM-FreePBX1 ext4 8de3ecdd-7d4b-4f9f-b40f-32ed96cc05b0
¦ +-VM-FreePBX2 ext4 8d473307-9344-4e98-bd34-bfbe447a34fb
¦ +-VM-FreePBX3 swap 82452bcc-6cdf-4995-a05b-8ea4f21afc60
+-VM-Samba--4
¦ +-VM-Samba--4p1 xfs 900df4a5-3b6b-40cc-9a79-c9b583a855c1
¦ +-VM-Samba--4p2 LVM2_member ub88qv-e2E5-ixUr-cnZR-i6VY-Vpqt-48ivKP
+-VM-Win2012
¦ +-VM-Win2012p1 ntfs System Reserved 9AFE7280FE72548B
¦ +-VM-Win2012p2 ntfs 3AF078E8F078AC2F
+-VM-Music
¦ +-VM-Music1 ext4 994203e1-6da2-461f-b1e9-a6412008371a
+-VM-Odoo
¦ +-VM-Odoo1 xfs 9ec550fe-351f-4efa-8ecd-1dd9bb84c0ad
¦ +-VM-Odoo2 LVM2_member YVw872-6szt-mjX9-DSc1-Gp2g-nvCD-e3TweJ
+-VM-LDAP
¦ +-VM-LDAP1 xfs a0431cfa-12ae-4f78-a123-78143baef620
¦ +-VM-LDAP2 LVM2_member 7L2ic8-ll1Z-UKCi-92Ru-8CRu-fa9G-P9ciCJ
+-VM-Plex
¦ +-VM-Plex1 xfs 8a725b5a-1c10-4eb5-bcfb-dfec4ea2909c
¦ +-VM-Plex2 LVM2_member LxUFEH-ZBZc-Mrvi-GXsn-aiCS-NfbE-rSUmTu
+-VM-Media
+-VM-2017--WebServer
sdb
+-sdb1 ext4 Backup c90662c7-cb70-4fcc-9207-d9f4cba3e7ba /mnt/removable
sdc iso9660 CentOS 7 x86_64 2014-07-04-22-13-38-00
+-sdc1 iso9660 CentOS 7 x86_64 2014-07-04-22-13-38-00
+-sdc2 vfat ANACONDA F58A-C739
sr0

All LV's are used to hold VM's. I don't remember ever using DD to duplicate one, but it certainly is possible.
 
Old 01-14-2017, 08:35 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
Old 01-15-2017, 07:50 AM   #6
scottthepotter
LQ Newbie
 
Registered: Jan 2017
Location: Erie, CO
Distribution: CentOS, Debian
Posts: 3

Original Poster
Rep: Reputation: Disabled
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:

Code:
NAME                           FSTYPE      LABEL           UUID                                   MOUNTPOINT
sda                                                                                               
├─sda1                                                                                            
├─sda2                         ext4                        b47ad709-7459-4dc0-bd1f-96a305f8fcc1   /boot
├─sda3                         LVM2_member                 Hf3WiB-S2eg-HdQe-vh9M-ssKT-Orzw-DTeegm 
│ ├─centos-swap                swap                        5582427b-f280-4d59-8d39-e5e36fb860f1   [SWAP]
│ ├─centos-root                ext4                        31af4470-75ad-43a1-b810-0af43a1f84d8   /
│ └─centos-home                ext4                        870b47a7-2101-4cb8-8636-f76946b48b06   /home
└─sda4                         LVM2_member                 y0pytF-qOS3-vMuP-pO01-tf1d-SQZP-lLns0A 
  ├─VM-WebServer                                                                                  
  ├─VM-Asterisk                                                                                   
  ├─VM-Owncloud                                                                                   
  ├─VM-Win2008                                                                                    
  ├─VM-Win7                                                                                       
  ├─VM-PlayOn                                                                                     
  ├─VM-Samba--Share                                                                               
  ├─VM-Webserver--Backup--Data                                                                    
  ├─VM-Webserver--Backup                                                                          
  ├─VM-FreePBX                                                                                    
  ├─VM-Samba--4                                                                                   
  ├─VM-Win2012                                                                                    
  ├─VM-Music                                                                                      
  ├─VM-Odoo                                                                                       
  ├─VM-LDAP                                                                                       
  ├─VM-Plex                                                                                       
  ├─VM-Media                                                                                      
  └─VM-2017--WebServer                                                                            
sdb                                                                                               
└─sdb1                         ext4        Backup          c90662c7-cb70-4fcc-9207-d9f4cba3e7ba   /mnt/removable
sdc                            iso9660     CentOS 7 x86_64 2014-07-04-22-13-38-00                 
├─sdc1                         iso9660     CentOS 7 x86_64 2014-07-04-22-13-38-00                 
└─sdc2                         vfat        ANACONDA        F58A-C739                              
sr0

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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with LVM mirror and failed PV, can't recover -- Debian Squeeze lvm 2.02.66-5 Linux Ninja Linux - Server 2 06-02-2017 04:50 PM
[SOLVED] CURRENT: LVM/CRYPTSETUP duplicate devices in /dev/mapper again. GazL Slackware 11 01-31-2011 06:36 PM
does tar or bzip2 squash duplicate or near-duplicate files? garydale Linux - Software 6 11-19-2009 04:43 PM
[LVM] duplicate VGs jogo Linux - Server 1 10-09-2008 08:42 AM
Duplicate LVM mab1376 Linux - Software 0 06-26-2008 12:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration