[SOLVED] Device /dev/sdc1 excluded by a filter

Katoz96

Member
Apr 2, 2020
3
0
6
29
I currently have 2 small SSDs but I want to remove a damaged SSD and replace it with a much more bigger one and move all my VMs and containers in it leaving the small SSD just for Proxmox.

My new SSD is showing as /dev/sdc

I do fdisk /dev/sdc and then press n to create a new partition, I press p and I leave everything as default, finally I press w to save.

Next I do pvcreate /dev/sdc1 but I get Device /dev/sdc1 excluded by a filter.

Looking online I excluded some common problems but doing grep filter /etc/lvm/lvm.conf I found global_filter = [ "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" "r|/dev/mapper/.*-(vm|base)--[0-9]+--disk--[0-9]+|", [B][U]"r|/dev/sdc.*|"[/U][/B]]

What should I do? Should I change the disk label or can I remove /dev/sdc from the filter? And why that filter is present?

Thanks everyone for the help
 
that filter is non-standard (added by you or another admin?), if you want to use /dev/sdc with LVM you can remove that part of the filter config and LVM will allow you to use it.
 
  • Like
Reactions: Katoz96
It wasn’t added by me, I don’t really know why it’s there. I will remove it as soon as I get home from work

EDIT: I deleted that filter and now it's working. I don't remember adding it, I hope someone has some suggestions as to why it ended up there
 
Last edited:
Cool how deleted a filter please ?

This how do that :

Solution here : https://www.simplstor.com/index.php/support/support-faqs/118-lvm-dev-excluded-by-filter

To resume :


If you have created a new VD using a disk or group of disks that were previously partitioned, you may see a message like this when you try to initialize the virtual disk for LVM.
# pvcreate /dev/sdd Device /dev/sdd excluded by a filter.
If filter is correct (/etc/lvm/lvm.conf) and old partition table information found on the disk, you can wipe out the old partition information with "wipefs".
Code:
# wipefs -a /dev/sdd
/dev/sdd: 2 bytes were erased at offset 0x000001fe (dos): 55 aa
/dev/sdd: calling ioclt to re-read partition table: Success
Now, try pvcreate command again.
Code:
# pvcreate /dev/sdd
Physical volume "/dev/sdd" successfully created.
 
Last edited:
  • Like
Reactions: supotnickiy