在虚拟机中添加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了。
pvcreate /dev/sdb



