Centos7

Centos 7 無法增加分區,發現設備重複

  • August 2, 2019

我試圖在我們的一台伺服器上增加usr分區var,但是當我輸入時我有這個警告(見下圖)pvs

後來當我嘗試擴展分區時它會拋出很多警告和錯誤

在此處輸入圖像描述

有沒有辦法解決這個問題?

lvs結果是:

WARNING: found device with duplicate /dev/md3
WARNING: found device with duplicate /dev/sdb3
WARNING: Disabling lvmetad cache which does not support PVs
WARNING: Scan found duplicate PVs
WARNING: Not using lvmetad because cache update failed
WARNING: Not suing device /dev/md3 for PV .....
WARNING: PV ... prefer device /dev/sda3 because of previous preference
WARNING: Device mismatch detected for vg00/urs with is accessing /dev/md3 instead of /dev/sda3, /dev/sda3
WARNING: Device mismatch detected for vg00/var with is accessing /dev/md3 instead of /dev/sda3, /dev/sda3
WARNING: Device mismatch detected for vg00/home with is accessing /dev/md3 instead of /dev/sda3
LV   VG    Attr       LSize
home vg00  -wi-ao---- 5GB
usr  vg00  -wi-ao---- 6GB
var  vg00  -wi-ao---- 105GB

df -h結果是:

Filesystem                  Mounted on
/dev/md1                    /
devtmpfs                    /dev 
tmpfs                       /dev/shm
tmpfs                       /run
tmpfs                       /sys/fs/cgroup
/dev/mapper/vg00-usr        /usr
none                        /tmp
/dev/mapper/vg00-home       /home
/dev/mapper/vg00-var        /var
tmpfs                       /run/user/10010

lvmdiskscan結果是:

WARNING: found device with duplicate /dev/md3
WARNING: found device with duplicate /dev/sdb3
WARNING: Disabling lvmetad cache which does not support PVs
WARNING: Scan found duplicate PVs
WARNING: Not using lvmetad because cache update failer
/dev/vg00/usr
/dev/md1
/dev/vg00/var
/dev/sda2
/dev/vg00/home
/dev/md3           LVM phisical volume
/dev/sdb2
3 disks
3 partitions
0 LVM phisical volume whole disks
1 LVM phisical volume

blkid結果

/dev/md1: LABEL="root" UUID="6edddd0e-a52c-45ff-8ece-24e93448a69e" TYPE="ext3" 
/dev/sdb1: UUID="e5096346-4290-310d-1f51-fb8978ee93fe" TYPE="linux_raid_member" 
/dev/mapper/vg00-usr: LABEL="usr" UUID="5a86bc5c-f160-4353-83cd-d44703842676" TYPE="ext4" 
/dev/sda3: UUID="a0045011-687b-f338-1f51-fb8978ee93fe" TYPE="linux_raid_member" 
/dev/sda2: UUID="6064f77c-72bc-42f9-9dfe-584ec9d74385" TYPE="swap" 
/dev/sdb2: UUID="bf72d033-bc14-4780-b19f-d2f87ef40b7c" TYPE="swap" 
/dev/sda1: UUID="e5096346-4290-310d-1f51-fb8978ee93fe" TYPE="linux_raid_member" 
/dev/sdb3: UUID="a0045011-687b-f338-1f51-fb8978ee93fe" TYPE="linux_raid_member" 
/dev/md3: UUID="WofUlL-4B5d-Lt97-R4ml-fj7f-kzch-IWcfLn" TYPE="LVM2_member" 
/dev/mapper/vg00-var: LABEL="var" UUID="3c9e5ddf-6933-40a0-b8d4-a6f877f8c228" TYPE="ext4" 
/dev/mapper/vg00-home: LABEL="home" UUID="902855cd-8f75-4241-8307-f8f4aa43fb0d" TYPE="ext4"

最後我聯繫了我的提供商,因為安裝映像本身來自他們,他們告訴我這是某些 Centos 7 發行版的問題。

以下是他們修復它的方法:

首先,我備份了您的 lvm.conf 文件:

# cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.bak

我們編輯了配置文件以正確過濾

# vi /etc/lvm/lvm.conf

filter = [ "a|/dev/md.*|", "r/.*/" ]

然後我跑vgscanpvscan確認問題已解決。

建議您在執行 LVM 之前重新啟動伺服器。

引用自:https://serverfault.com/questions/977388