创建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.
只有经历过生活的苦难
才会更加努力去生活
自己梦想的一切
更加需要自己脚踏实地的去践行
结果未必尽如人意
但是路途中的努力
一定比结果更加美丽
----by ljw