Device /dev/sdX excluded by a filter

在进行pvcreate创建PV时,可能会遇到Device /dev/sdX excluded by a filter报错,一般出现这个错误是在通过parted分区并删除相应的分区信息以后。遇到这种情况有两种解决方法:

1、通过wipefs 指令清理盘信息

# wipefs -a /dev/sdb
/dev/sdb: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 8 bytes were erased at offset 0x13ffffe00 (gpt): 45 46 49 20 50 41 52 54
/dev/sdb: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdb: calling ioclt to re-read partition table: Success

上面的方法是推荐方法,执行过后再进行分区创建就可以成功了:

# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.

2、通过parted重建label卷标

[root@servera ~]# parted /dev/vdb
GNU Parted 3.2
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) quit
Information: You may need to update /etc/fstab.
[root@servera ~]# pvcreate /dev/vdb
  Device /dev/vdb excluded by a filter.
[root@servera ~]# parted /dev/vdb mklabel msdos
Warning: The existing disk label on /dev/vdb will be destroyed and all data on this disk will be lost. Do you
want to continue?
Yes/No? yes
Information: You may need to update /etc/fstab.
[root@servera ~]# pvcreate /dev/vdb
WARNING: dos signature detected on /dev/vdb at offset 510. Wipe it? [y/n]: y
  Wiping dos signature on /dev/vdb.
  Physical volume "/dev/vdb" successfully created.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注