Device /dev/sdb excluded by a filter

(0 comments)

  在将Solaris的虚拟机重新安装Linux后,准备将之前Solaris格式的磁盘重新做成PV,不过出现如下报错:

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

看报错信息,貌似是北lvm.conf配置filter,但是检查配置文件,并没有filter。

运行fdisk命令查看磁盘信息,发现输出和普通的Linux磁盘有所区别。

root@host1:~# fdisk -l /dev/sdb
Disk /dev/sdb: 250 GiB, 268435456000 bytes, 524288000 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
Disklabel type: dos
Disk identifier: 0xf3ccdff7

Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 524285951 524285889 250G 42 SFS

所以导致问题的原因是Linux并不能识别磁盘的分区表,运行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,可以将磁盘创建为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.

Current rating: 3.2

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required