LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-17-2019, 09:52 AM   #1
targettor
LQ Newbie
 
Registered: Jul 2019
Location: Switzerland
Distribution: CentOS, Ubuntu, AlmaLinux, Rocky Linux, RHEL
Posts: 7

Rep: Reputation: Disabled
pvcreate: Device /dev/sda excluded by a filter.


Hi
I would like to add a new SATA disk to my system (CentOS 7.6) by using LVM.
I intend to not use a partition table, and just add the raw device to the LVM. (I do that all the time on CentOS systems)
The block device is visible by the OS, but the LVM is refusing to add it.
The computer is a Intel NUC, and the OS is running from an NVMe SSD.

Code:
# pvcreate /dev/sda
  Device /dev/sda excluded by a filter.

# wipefs /dev/sda

# dd if=/dev/zero of=/dev/sda bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000236933 s, 2.2 MB/s

# pvcreate /dev/sda
  Device /dev/sda excluded by a filter.

# grep 'filter =' /etc/lvm/lvm.conf | egrep -v '^\s*#'
(There are no filters defined)

Code:
# lsblk
NAME                             MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                8:0    0   1.8T  0 disk
└─ST2000LX001-1RG174_WDZKLS0H    253:1    0   1.8T  0 mpath
  └─ST2000LX001-1RG174_WDZKLS0H1 253:2    0   1.8T  0 part
nvme0n1                          259:0    0 894.3G  0 disk
├─nvme0n1p1                      259:1    0    30G  0 part  /boot/efi
├─nvme0n1p2                      259:2    0     1G  0 part  /boot
├─nvme0n1p3                      259:3    0    16G  0 part  [SWAP]
├─nvme0n1p4                      259:4    0    60G  0 part
│ └─vg_root-root                 253:0    0    60G  0 lvm   /
└─nvme0n1p5                      259:5    0 787.3G  0 part
  └─vg_data_nvme-lv_t1           253:3    0 787.3G  0 lvm   /exports/data-t1

# fdisk -l /dev/sda

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

# ls -l /sys/block/
total 0
lrwxrwxrwx. 1 root root 0 Jul 17 15:05 dm-0 -> ../devices/virtual/block/dm-0
lrwxrwxrwx. 1 root root 0 Jul 17 15:05 dm-1 -> ../devices/virtual/block/dm-1
lrwxrwxrwx. 1 root root 0 Jul 17 15:05 dm-2 -> ../devices/virtual/block/dm-2
lrwxrwxrwx. 1 root root 0 Jul 17 15:05 dm-3 -> ../devices/virtual/block/dm-3
lrwxrwxrwx. 1 root root 0 Jul 17 15:05 nvme0n1 -> ../devices/pci0000:00/0000:00:1d.0/0000:6d:00.0/nvme/nvme0/nvme0n1
lrwxrwxrwx. 1 root root 0 Jul 17 15:05 sda -> ../devices/pci0000:00/0000:00:17.0/ata3/host2/target2:0:0/2:0:0:0/block/sda

# ls -l /dev/sda
brw-rw----. 1 root disk 8, 0 Jul 17 16:25 /dev/sda
So I tried to go get a more verbose message from pvcreate and pvscan:
Code:
# pvcreate /dev/sda -vvv
        Parsing: pvcreate /dev/sda -vvv
        Recognised command pvcreate_general (id 100 / enum 80).
      devices/global_filter not found in config: defaulting to global_filter = [ "a|.*/|" ]
        Sysfs filter initialised.
        Internal filter initialised.
        LVM type filter initialised.
        Usable device filter initialised.
        mpath filter initialised.
        Partitioned filter initialised.
        MD filter initialised.
        Composite filter initialised.
      devices/cache not found in config: defaulting to /etc/lvm/cache/.cache
        Persistent filter initialised.
      metadata/record_lvs_history not found in config: defaulting to 0
        DEGRADED MODE. Incomplete RAID LVs will be processed.
        Processing command: pvcreate /dev/sda -vvv
        Command pid: 24910
        System ID:
        O_DIRECT will be used
      File-based locking selected.
        Preparing SELinux context for /run/lock/lvm to system_u:object_r:lvm_lock_t:s0.
        Resetting SELinux context to default value.
      metadata/pvmetadataignore not found in config: defaulting to 0
      metadata/pvmetadatasize not found in config: defaulting to 255
      metadata/pvmetadatacopies not found in config: defaulting to 1
      report/output_format not found in config: defaulting to basic
      log/report_command_log not found in config: defaulting to 0
[...]
      devices/cache not found in config: defaulting to /etc/lvm/cache/.cache
        Persistent filter initialised.
        Finding devices to scan
        Creating list of system devices.
        Found dev 8:0 /dev/sda - new.
        Found dev 8:0 /dev/disk/by-id/ata-ST2000LX001-1RG174_WDZKLS0H - new alias.
        Found dev 8:0 /dev/disk/by-id/wwn-0x5000c500c00645df - new alias.
        Found dev 8:0 /dev/disk/by-path/pci-0000:00:17.0-ata-3.0 - new alias.
[...]
      /dev/sda: size is 3907029168 sectors
        Closed /dev/sda
        dm version   [ opencount flush ]   [16384] (*1)
        dm status   (253:1) [ opencount flush ]   [16384] (*1)
        /dev/sda: Skipping mpath component device
        filter caching bad /dev/sda
        dm status   (253:0) [ noopencount noflush ]   [16384] (*1)
        Opened /dev/vg_root/root RO O_DIRECT
[...]
        Scanned devices: read errors 0 process errors 0 failed 0
        Found VG info for 2 VGs
        /dev/sda: filter cache skipping (cached bad)
        Processing each PV
        Getting list of all devices
        /dev/nvme0n1: filter cache using (cached good)
        /dev/sda: filter cache skipping (cached bad)
        /dev/vg_root/root: filter cache using (cached good)
        /dev/nvme0n1p1: filter cache using (cached good)
        /dev/mapper/ST2000LX001-1RG174_WDZKLS0H: filter cache using (cached good)
        /dev/nvme0n1p2: filter cache using (cached good)
        /dev/mapper/ST2000LX001-1RG174_WDZKLS0H1: filter cache using (cached good)
        /dev/nvme0n1p3: filter cache using (cached good)
        /dev/vg_data_nvme/lv_t1: filter cache using (cached good)
        /dev/nvme0n1p4: filter cache using (cached good)
        /dev/nvme0n1p5: filter cache using (cached good)
[...]
        Completed: pvcreate /dev/sda -vvv
So far, I can see the following messagees standing out:
/dev/sda: Skipping mpath component device
/dev/sda: filter cache skipping (cached bad)

Not sure what to do next.
Any help would be appreciated.

Cheers
 
Old 07-17-2019, 10:19 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Have you created a partition and create a PV of that partition?

So, something like "pvcreate /dev/sda1"
 
Old 07-17-2019, 02:42 PM   #3
targettor
LQ Newbie
 
Registered: Jul 2019
Location: Switzerland
Distribution: CentOS, Ubuntu, AlmaLinux, Rocky Linux, RHEL
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dc.901 View Post
Have you created a partition and create a PV of that partition?

So, something like "pvcreate /dev/sda1"
Yes, I did try that.
After creating a partition, pvcreate is giving me the same error.
 
Old 07-17-2019, 03:41 PM   #4
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
pvcreate is telling you that you need to execute the command on the multipath device, not on /dev/sda which is just one path to the device.

lsblk is telling you that the the multipath device is named ST2000LX001-1RG174_WDZKLS0H (mpath) and the partition is named ST2000LX001-1RG174_WDZKLS0H1 (part).

You can find more info by running "multipath -ll".
 
1 members found this post helpful.
Old 07-18-2019, 07:48 AM   #5
targettor
LQ Newbie
 
Registered: Jul 2019
Location: Switzerland
Distribution: CentOS, Ubuntu, AlmaLinux, Rocky Linux, RHEL
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
pvcreate is telling you that you need to execute the command on the multipath device, not on /dev/sda which is just one path to the device.

lsblk is telling you that the the multipath device is named ST2000LX001-1RG174_WDZKLS0H (mpath) and the partition is named ST2000LX001-1RG174_WDZKLS0H1 (part).

You can find more info by running "multipath -ll".
Yes, I think that's the solution to the problem. - many thanks @smallpond!
I was finally able to create a LVM volume.

However - a word of frustration:
  • I find the process totally unintuitive.
  • And the message from pvcreate is unclear about having to use the multipath name instead of the block device name.
  • I can't see a good reason why pvcreate /dev/sda should not work.

Here is how I fixed my issue:
Code:
# multipath -ll
ST2000LX001-1RG174_WDZKLS0H dm-1 ATA     ,ST2000LX001-1RG1
size=1.8T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 2:0:0:0 sda     8:0   active ready running
[root@nuc1 ~]# ll /dev/mapper/ST2000LX001-1RG174_WDZKLS0H
lrwxrwxrwx. 1 root root 7 Jul 18 14:03 /dev/mapper/ST2000LX001-1RG174_WDZKLS0H -> ../dm-1
[root@nuc1 ~]# pvcreate /dev/mapper/ST2000LX001-1RG174_WDZKLS0H
  Physical volume "/dev/mapper/ST2000LX001-1RG174_WDZKLS0H" successfully created.
[root@nuc1 ~]# lvmdiskscan
  /dev/nvme0n1                            [     894.25 GiB]
  /dev/vg_root/root                       [      60.00 GiB]
  /dev/nvme0n1p1                          [      30.00 GiB]
  /dev/mapper/ST2000LX001-1RG174_WDZKLS0H [      <1.82 TiB] LVM physical volume
  /dev/nvme0n1p2                          [       1.00 GiB]
  /dev/vg_data_nvme/lv_t1                 [    <787.25 GiB]
  /dev/nvme0n1p3                          [      16.00 GiB]
  /dev/nvme0n1p4                          [      60.00 GiB] LVM physical volume
  /dev/nvme0n1p5                          [    <787.25 GiB] LVM physical volume
  1 disk
  5 partitions
  1 LVM physical volume whole disk
  2 LVM physical volumes
[root@nuc1 ~]# vgcreate vg_data_spinning /dev/mapper/ST2000LX001-1RG174_WDZKLS0H
  Volume group "vg_data_spinning" successfully created
[root@nuc1 ~]# lvcreate -l +100%FREE -n lv_t2 vg_data_spinning
  Logical volume "lv_t2" created.
[root@nuc1 ~]# mkfs.xfs /dev/mapper/vg_data_spinning-lv_t2
meta-data=/dev/mapper/vg_data_spinning-lv_t2 isize=512    agcount=4, agsize=122094592 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=488378368, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=238466, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Last edited by targettor; 07-18-2019 at 08:00 AM.
 
Old 07-19-2019, 04:49 PM   #6
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,140

Rep: Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263Reputation: 1263
Code:
# pvcreate /dev/sda
  Device /dev/sda excluded by a filter.
Yeah. That is one of the least informative error messages I've ever seen. The lvm code in general is over-engineered crap. It disguises some fairly straightforward ideas behind overwhelming obscurity. For example, lvm goes out of its way to flag an error if you have a file descriptor open (for logging, for example) when you call one of their commands.
 
Old 09-17-2020, 06:22 PM   #7
genese
Member
 
Registered: Feb 2006
Location: belgium
Posts: 76

Rep: Reputation: 20
Same problem here, solved by adding the -a flag to the wipefs command.
Code:
# pvcreate /dev/sda
  Device /dev/sda excluded by a filter.
# wipefs -a /dev/sda
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 8 bytes were erased at offset 0x1d1c1115e00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sda: calling ioclt to re-read partition table: Success
# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created.
 
3 members found this post helpful.
Old 11-28-2020, 02:33 PM   #8
targettor
LQ Newbie
 
Registered: Jul 2019
Location: Switzerland
Distribution: CentOS, Ubuntu, AlmaLinux, Rocky Linux, RHEL
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by genese View Post
Same problem here, solved by adding the -a flag to the wipefs command.
Code:
# pvcreate /dev/sda
  Device /dev/sda excluded by a filter.
# wipefs -a /dev/sda
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 8 bytes were erased at offset 0x1d1c1115e00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sda: calling ioclt to re-read partition table: Success
# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created.
@genese Many thanks for adding this.

I just tried that on a new system.
On my computer, "wipefs -af /dev/sda" did not fix the issue.
I really had to run "pvcreate" against the mpath name.
And this time, the OS is CentOS 8.2.
 
Old 10-13-2021, 12:18 PM   #9
TayyabTahir
LQ Newbie
 
Registered: Oct 2021
Posts: 1

Rep: Reputation: Disabled
Worked for me. Thanks

Quote:
Originally Posted by genese View Post
Same problem here, solved by adding the -a flag to the wipefs command.
Code:
# pvcreate /dev/sda
  Device /dev/sda excluded by a filter.
# wipefs -a /dev/sda
/dev/sda: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 8 bytes were erased at offset 0x1d1c1115e00 (gpt): 45 46 49 20 50 41 52 54
/dev/sda: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sda: calling ioclt to re-read partition table: Success
# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created.

Worked for me.
Thanks
 
Old 01-19-2023, 01:42 PM   #10
gabesaucedo
LQ Newbie
 
Registered: Apr 2013
Posts: 1

Rep: Reputation: Disabled
Thansk for the info, it worked as a charm. I had to use the multipath name for it to work.

Code:
$ sudo multipath -ll
Jan 19 13:39:21 | /etc/multipath.conf line 16, invalid keyword: getuid_callout
Jan 19 13:39:21 | /etc/multipath.conf line 27, invalid keyword: getuid_callout
Jan 19 13:39:21 | /etc/multipath.conf line 37, invalid keyword: getuid_callout
3600508b1001c8b10ad6bf25c875fc40b dm-7 HP      ,LOGICAL VOLUME
size=1.5T features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 0:1:0:2 sdc 8:32 active ready running
3600508b1001c13ca557d5375da4eaa08 dm-3 HP      ,LOGICAL VOLUME
size=838G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 0:1:0:1 sdb 8:16 active ready running

$ ll /dev/mapper/3600508b1001c13ca557d5375da4eaa08
lrwxrwxrwx 1 root root 7 Aug  9 17:29 /dev/mapper/3600508b1001c13ca557d5375da4eaa08 -> ../dm-3

$ sudo pvcreate /dev/mapper/3600508b1001c8b10ad6bf25c875fc40b
WARNING: xfs signature detected on /dev/mapper/3600508b1001c8b10ad6bf25c875fc40b at offset 0. Wipe it? [y/n]: y
  Wiping xfs signature on /dev/mapper/3600508b1001c8b10ad6bf25c875fc40b.
  Physical volume "/dev/mapper/3600508b1001c8b10ad6bf25c875fc40b" successfully created.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pvcreate issue (excluded by a filter) Ujio Linux - General 6 07-15-2019 01:19 AM
LXer: pvcreate error: Device /dev/xyz not found (or ignored by filtering). LXer Syndicated Linux News 0 03-28-2017 02:33 AM
iscsi: which local device (/dev/sda, /dev/sdb) is used WITHOUT dmesg? knikkerr Linux - Software 3 08-13-2010 04:30 AM
Installing RIP LinuX on a USB drive - device name /dev/sdc becomes /dev/sda Mleahy Linux - Software 1 07-30-2008 08:57 PM
how the device will take the name as /dev/sda.../dev/sdb... ? sanjay2004 Linux - Software 1 05-27-2008 09:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration