Solution for pvcreate error: Device /dev/xyz not found (or ignored by filtering). Troubleshooting steps and resolution for this error.
Sometimes when adding new disk/LUN to Linux machine using pvcreate you may come across below error :
Device /dev/xyz not found (or ignored by filtering).
# pvcreate /dev/sdb
Device /dev/sdb not found (or ignored by filtering).
This is due to disk was used in different volume managers (possibly Linux own fdisk
manager) and now you are trying to use it in LVM. To resolve this error, first, check if it has fdisk
partitions using fdisk
command :
# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/sdb: 859.0 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x62346fee6
Device Boot Start End Blocks Id System
/dev/sdb1 1 104433 838858041 83 Linux
In the above example, you can print the current partition table of the disk using p
option under fdisk
menu.
You can see there is one primary partition detected using fdisk
. Because of this LVM command to initialize this disk (pvcreate
) failed.
To resolve this you need to remove this partition and re-initialize disk in LVM. To delete partition use d
option under fdisk
menu.
# fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help):d
Selected partition 1
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
After issuing delete d
command under fdisk
menu, you need to write (w) changes on disk. This will remove your existing partition on the disk. Once again you can use print p
option to make sure that there is no fdisk
partition on the disk.
You can now use disk in LVM without any issue.
# pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created
If this solution doesn’t work for you or there were no partitions on disk previously and still, if you get this error then you may want to look at your multipath configurations. The hint is to look at your verbose pvcreate
output to check where it’s failing. Use pvcreate -vvv /dev/<name>
command.
Sanjeev says
i have done the same but the pvcreate is still showing the same error
#pvcreate /dev/sdb
Device /dev/sdb not found (or ignored by filtering).
Shrikant Lavhate says
Look at the last para of this article. verbose output of command and multipathing are two areas you need to explore.