我试图增加我们的一台服务器上的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"
答案1
最后我联系了我的提供商,因为安装映像本身来自他们,他们告诉我这是某些 Centos 7 发行版的问题。
以下是他们修复方法:
首先,我备份了您的 lvm.conf 文件:
# cp /etc/lvm/lvm.conf /etc/lvm/lvm.conf.bak
我们编辑了配置文件以正确过滤
# vi /etc/lvm/lvm.conf
filter = [ "a|/dev/md.*|", "r/.*/" ]
然后我运行vgscan
并pvscan
确认问题已解决。
建议您在执行 LVM 之前重新启动服务器。