在创建lvm的时候,报一下错误:

[root@oradbca ~]#  vgcreate vg_data /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdb not /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdc not /dev/sdb
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdd not /dev/sdc
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sde not /dev/sdd
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sddlmaa not /dev/sde
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdb not /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdc not /dev/sdb
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdd not /dev/sdc
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sde not /dev/sdd
  Volume group "vg_data" successfully created

虽然创建成功了,,但是感觉有点别扭。

同时创建的盘也不是我多路径上的盘

[root@oradbca ~]# pvdisplay 
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdb not /dev/sddlmaa
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdc not /dev/sdb
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sdd not /dev/sdc
  Found duplicate PV YjFs3QZw30enKplsoQ5YmFFnDV08Owyy: using /dev/sde not /dev/sdd
  --- Physical volume ---
  PV Name               /dev/sde
  VG Name               vg_data
  PV Size               2.44 TiB / not usable 4.00 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              639999
  Free PE               367
  Allocated PE          639632
  PV UUID               YjFs3Q-Zw30-enKp-lsoQ-5YmF-FnDV-08Owyy

原因是:默认的扫描设置是扫描所有的磁盘,由于多路径的问题,多块磁盘前面的元数据信息是一致的,导致PV信息相同

所以直接修改lvm的配置文件,修改扫描的策略就可以了。

我的fdisk -l 内容


Disk /dev/sda: 1199.1 GB, 1199101181952 bytes
255 heads, 63 sectors/track, 145782 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000a399

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        8185    65536000   82  Linux swap / Solaris
/dev/sda3            8185      145783  1105255424   8e  Linux LVM

Disk /dev/sdb: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdc: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/VolGroup-LogVol00: 1131.8 GB, 1131774214144 bytes
255 heads, 63 sectors/track, 137597 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdd: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sde: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sddlmaa: 2684.4 GB, 2684354560000 bytes
255 heads, 63 sectors/track, 326354 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_data-lv_data: 2682.8 GB, 2682811056128 bytes
255 heads, 63 sectors/track, 326166 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

 

 

修改文件   /etc/lvm/lvm.conf

由原来的 

	filter = [ "a/.*/" ]

修改成   

	filter = [ "a/sddl.*/","a/sda.*/", "r/sd.*/" ]

a 是允许  b是拒绝

由于我在sda上也有lvm 所以单独允许。

 

修改后 允许 vgscan -v  重建缓存 

运行lvmdiskscan 查看当前的访问路径

 

[root@whljk ~]# lvmdiskscan 
  /dev/ram0            [      16.00 MiB] 
  /dev/sddlmaa         [       2.44 TiB] LVM physical volume
  /dev/root            [       1.03 TiB] 
  /dev/ram1            [      16.00 MiB] 
  /dev/sda1            [     200.00 MiB] 
  /dev/vg_data/lv_data [       2.44 TiB] 
  /dev/ram2            [      16.00 MiB] 
  /dev/sda2            [      62.50 GiB] 
  /dev/ram3            [      16.00 MiB] 
  /dev/sda3            [       1.03 TiB] LVM physical volume
  /dev/ram4            [      16.00 MiB] 
  /dev/ram5            [      16.00 MiB] 
  /dev/ram6            [      16.00 MiB] 
  /dev/ram7            [      16.00 MiB] 
  /dev/ram8            [      16.00 MiB] 
  /dev/ram9            [      16.00 MiB] 
  /dev/ram10           [      16.00 MiB] 
  /dev/ram11           [      16.00 MiB] 
  /dev/ram12           [      16.00 MiB] 
  /dev/ram13           [      16.00 MiB] 
  /dev/ram14           [      16.00 MiB] 
  /dev/ram15           [      16.00 MiB] 
  2 disks
  18 partitions
  1 LVM physical volume whole disk
  1 LVM physical volume

 

正常显示

原创文章,转载请注明: 转载自ORADBCA

本文链接地址: 创建lvm Found duplicate PV的错误

36.3K