Linux: LVM – pvcreate Device /dev/sdb4 excluded by a filter.

By | 03/09/2019
 

During new Linux set up – suddenly got a weird message.

It happen just because of my carelessness and haste.

Let’s create new partition:

[simterm]

[root@archiso ~]# pvcreate /dev/sdb4
  Device /dev/sdb4 excluded by a filter.

[/simterm]

Check new partition size:

[simterm]

[root@archiso ~]# lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 476.7M  1 loop /run/archiso/sfs/airootfs
sda      8:0    0 223.6G  0 disk 
├─sda1   8:1    0   499M  0 part 
├─sda2   8:2    0   100M  0 part 
├─sda3   8:3    0    16M  0 part 
└─sda4   8:4    0   223G  0 part 
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0 488.3G  0 part 
├─sdb2   8:18   0   512M  0 part 
├─sdb3   8:19   0   512M  0 part 
└─sdb4   8:20   0     1K  0 part

[/simterm]

sdb4 8:20 0 1K 0 part – Er… What?

Okay – the simplest solution is just to drop it and re-create:

[simterm]

[root@archiso ~]# fdisk /dev/sdb
...
Command (m for help): d
Partition number (1-4, default 4): 

Partition 4 has been deleted.

Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): 

Using default response e.
Selected partition 4
First sector (1026099200-1953525167, default 1026099200): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026099200-1953525167, default 1953525167): 

Created a new partition 4 of type 'Extended' and of size 442.2 GiB.

Command (m for help): p
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA DT01ACA1
...
Device     Boot      Start        End    Sectors   Size Id Type
/dev/sdb1             2048 1024002047 1024000000 488.3G  7 HPFS/NTFS/exFAT
/dev/sdb2       1024002048 1025050623    1048576   512M ef EFI (FAT-12/16/32)
/dev/sdb3       1025050624 1026099199    1048576   512M 83 Linux
/dev/sdb4       1026099200 1953525167  927425968 442.2G  5 Extended

[/simterm]

442.2G – looks good?

Check again with the lsblk:

[simterm]

[root@archiso ~]# lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 476.7M  1 loop /run/archiso/sfs/airootfs
sda      8:0    0 223.6G  0 disk 
├─sda1   8:1    0   499M  0 part 
├─sda2   8:2    0   100M  0 part 
├─sda3   8:3    0    16M  0 part 
└─sda4   8:4    0   223G  0 part 
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0 488.3G  0 part 
├─sdb2   8:18   0   512M  0 part 
├─sdb3   8:19   0   512M  0 part 
└─sdb4   8:20   0     1K  0 part

[/simterm]

WTF?

And only from the second attaempt I saw the “issue”:

[simterm]

...
Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): 

Using default response e.
...

[/simterm]

“Using default response e.” – when there are already three Primary partitions present on a disk –fdisk will suggest to use the Extended, type for a next one instead of  Primary.

Create it one more time:

[simterm]

[root@archiso ~]# fdisk /dev/sdb
...
Command (m for help): d
Partition number (1-4, default 4): 

Partition 4 has been deleted.

Command (m for help): n
Partition type
   p   primary (3 primary, 0 extended, 1 free)
   e   extended (container for logical partitions)
Select (default e): p

Selected partition 4
First sector (1026099200-1953525167, default 1026099200): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026099200-1953525167, default 1953525167): 

Created a new partition 4 of type 'Linux' and of size 442.2 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

[/simterm]

“Created a new partition 4 of type ‘Linux'” – now all correct.

Check it’s size:

[simterm]

[root@archiso ~]# lsblk /dev/sdb
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb      8:16   0 931.5G  0 disk 
├─sdb1   8:17   0 488.3G  0 part 
├─sdb2   8:18   0   512M  0 part 
├─sdb3   8:19   0   512M  0 part 
└─sdb4   8:20   0 442.2G  0 part

[/simterm]

Done.