创建LVM时,报错Device /dev/sdd excluded by a filter.

时间:2023-03-21
本文章向大家介绍创建LVM时,报错Device /dev/sdd excluded by a filter.,主要内容包括方法一、方法二、使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。
  • 创建pv时,发现sdd磁盘报错,被筛选器排除了,这是什么原因呢

[root@junwu_server ~]# pvcreate /dev/sdd /dev/sde
Device /dev/sdd excluded by a filter.
Physical volume "/dev/sde" successfully created.

  • 并且sdd磁盘也无法格式化,必须加-f强制格式化才行,提示已经存在一个文件系统了,看到这里大概就猜到了,因为存在一个文件系统,所有无法直接创建新的文件系统

[root@junwu_server ~]# mkfs.xfs /dev/sdd
mkfs.xfs: /dev/sdd appears to contain an existing filesystem (linux_raid_member).
mkfs.xfs: Use the -f option to force overwrite.

##我们创建一个新的磁盘看下有什么不同

方法一

  • 格式化文件系统,再进行pv创建

方法二

  • parted重新创建分区表

##找一个同样报错的磁盘sdf

[root@junwu_server ~]# pvcreate /dev/sdf
Device /dev/sdf excluded by a filter.

[root@junwu_server ~]# parted /dev/sdf
GNU Parted 3.1
Using /dev/sdf
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos
Warning: The existing disk label on /dev/sdf will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? y
(parted) q

Information: You may need to update /etc/fstab.

##也没有解决啊!

[root@junwu_server ~]# pvcreate /dev/sdf
Can't open /dev/sdf exclusively. Mounted filesystem?
Can't open /dev/sdf exclusively. Mounted filesystem?

##根据报错,查看下是否有挂载

[root@junwu_server ~]# df -hl
Filesystem Size Used Avail Use% Mounted on
devtmpfs 476M 0 476M 0% /dev
tmpfs 487M 0 487M 0% /dev/shm
tmpfs 487M 7.7M 479M 2% /run
tmpfs 487M 0 487M 0% /sys/fs/cgroup
/dev/sda3 20G 2.6G 17G 14% /
/dev/sda1 197M 110M 88M 56% /boot
tmpfs 98M 0 98M 0% /run/user/0

[root@junwu_server ~]# umount /dev/sdf
umount: /dev/sdf: not mounted

##终于查到sdf在raid5中是激活状态,被用做raid盘,关闭就好了

[root@junwu_server ~]# cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4]
md5 : active (auto-read-only) raid5 sdg[3] sdf[4]
41908224 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [U_U]

[root@junwu_server ~]# mdadm -S /dev/md5
mdadm: stopped /dev/md5

##太难了!!!

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

原文地址:https://www.cnblogs.com/junwured/p/17238258.html