Device /dev/sdb excluded by a filter

 在虚拟机中添加SCSI格式的磁盘做PV时出现如下报错:

root@host1:~# pvcreate /dev/sdb
 Device /dev/sdb excluded by a filter.

导致问题的原因是添加的磁盘是在另一个虚拟机中新建的,已经有了分区表,现在的虚拟机并不能识别磁盘的分区表,运行parted命令重做分区表,中途需要输入三次命令。

root@host1:~# parted /dev/sdb
GNU Parted 3.2
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) quit
Information: You may need to update /etc/fstab.

再次运行pvcreate,问是否擦除dos签名,输入y,就可以将磁盘创建为PV了。

root@host1:~# pvcreate /dev/sdb
WARNING: dos signature detected on /dev/sdb at offset 510. Wipe it? [y/n]: y
 Wiping dos signature on /dev/sdb.
 Physical volume "/dev/sdb" successfully created.

你可能感兴趣的:(Device /dev/sdb excluded by a filter)