当前位置: 首页 > 工具软件 > Filter View > 使用案例 >

Linux运维遇见Device /dev/sdb excluded by a filter如何解决

郭洋
2023-12-01

保哥有一台服务器,以前安装的是Windows2016操作系统。近期,业务部署需求发生改变,需要安装rhel7.6。安装完操作系统后,开始挂载剩余的存储空间。创建lv的时候提示:Device /dev/sdb excluded by a filter。

操作步骤

1,查看以前Windows2016服务器下的空闲分区。

[root@gctn-east-p01 ~]# fdisk -l
Disk /dev/sdb: 4798.3 GB, 4798283776000 bytes, 9371648000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 1048576 bytes
Disk label type: gpt
Disk identifier: 58520033-4270-43FF-87E5-CA79567EC17F
# Start End Size Type Name
1 34 262177 128M Microsoft reser Microsoft reserved partition
Partition 1 does not start on physical sector boundary.
2 264192 9371645951 4.4T Microsoft basic Basic data partition

2,删除该分区/dev/sdb

[root@gctn-east-p01 ~]# fdisk /dev/sdb
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): d
Partition number (1,2, default 2):
Partition 2 is deleted
Command (m for help): d
Selected partition 1
Partition 1 is deleted
Command (m for help): w
The partition table has been altered!
[root@gctn-east-p01 ~]# pvcreate /dev/sdb
Device /dev/sdb excluded by a filter

解决方案

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

# 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.
 类似资料: