Centos7

Vgextend :“過濾器排除的設備”

  • September 30, 2020

我在一個新的實習,我被要求擴展一個卷組,看起來很好:

vgextend [my_group] /dev/sdb

但現在我收到一條錯誤消息告訴我:

Device /dev/sdb excluded by a filter` 

誰能幫我弄清楚什麼時候出錯,或者指導我設置過濾器的位置。

就我而言,我遇到了這個問題:

[root@test ~]# pvcreate /dev/vdb
 Device /dev/vdb excluded by a filter.

[root@test ~]# pvcreate /dev/vdb -vvv
...
     /dev/vdb: size is 385 sectors
       /dev/vdb: Skipping: Too small to hold a PV
       Closed /dev/vdb
...

所以我檢查了磁碟的大小並感到驚訝:

[root@test ~]# fdisk -l /dev/vdb

Disk /dev/vdb: 0 MB, 197120 bytes, 385 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

為了解決這個問題,我做了以下事情:

最初,當我創建磁碟時,我使用以下命令創建了它:

[root@kvmserver ~]# virsh attach-disk test --source /secret/test_disk1 --target vdb --persistent

這是錯誤的,所以我做了一點閱讀,發現我必須使用驅動程序(因為想像元數據)所以我做了以下事情:

[root@kvmserver ~]# virsh detach-disk test /secret/test_disk1 --config Disk detached successfully

[root@kvmserver ~]# virsh attach-disk test --source /secret/test_disk1 --target vdb --persistent --subdriver qcow2
Disk attached successfully

現在一切正常:

[root@test ~]# fdisk -l /dev/vdb

Disk /dev/vdb: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@test ~]# pvcreate /dev/vdb
 Physical volume "/dev/vdb" successfully created.

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