• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“Device /dev/mappper/mpath25 Not Found (or Ignored By Filtering)” – error while creating physical volume with pvcreate

by admin

The Problem

When trying to create physical volume , getting the below error

error:

# pvcreate /dev/mappper/mpath25
Device /dev/mappper/mpath25 not found (or ignored by filtering).

The issue can be reproduced at will with the following step:

# pvcreate /dev/mappper/mpath25

The Solution

Upon checking it was found that start sector was not zeroed out.

# pvcreate /dev/mappper/mpath25
Device /dev/mappper/mpath25 not found (or ignored by filtering).
# fdisk -l /dev/mapper/mpath25
Disk /dev/mapper/mpath25 doesn't contain a valid partition table

This shows that there was no pratition present on the disk. You can run the pvcreate command with verbose option “-vvv” to get more details on the error:

# pvcreate -vvv /dev/mapper/mpath25
Processing: pvcreate -vvv /dev/mapper/mpath25
O_DIRECT will be used
Setting global/locking_type to 1
Setting global/wait_for_locks to 1
File-based locking selected.
Setting global/locking_dir to /var/lock/lvm
metadata/pvmetadataignore not found in config: defaulting to n
metadata/pvmetadatasize not found in config: defaulting to 255
metadata/pvmetadatacopies not found in config: defaulting to 1
Locking /var/lock/lvm/P_orphans WB
_do_flock /var/lock/lvm/P_orphans:aux WB
_do_flock /var/lock/lvm/P_orphans WB
_undo_flock /var/lock/lvm/P_orphans:aux
dm version OF [16384]
dm status (253:11) OF [16384]
/dev/mapper/mpath25: New preferred name      ### indicates that it can find the device
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: size is 629145600 sectors
Closed /dev/mapper/mpath25
/dev/mapper/mpath25: size is 629145600 sectors
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
Using /dev/mapper/mpath25
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
/dev/mapper/mpath25: No label detected
Closed /dev/mapper/mpath25
dm status (253:11) OF [16384]
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: size is 629145600 sectors
Closed /dev/mapper/mpath25
/dev/mapper/mpath25: size is 629145600 sectors
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
Using /dev/mapper/mpath25
Opened /dev/mapper/mpath25 RW O_EXCL O_DIRECT
Closed /dev/mapper/mpath25
/dev/mapper/mpath25: size is 629145600 sectors
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
/dev/mapper/mpath25: size is 629145600 sectors
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
dm status (253:11) OF [16384]
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: size is 629145600 sectors
Closed /dev/mapper/mpath25
/dev/mapper/mpath25: size is 629145600 sectors
Opened /dev/mapper/mpath25 RO O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
Using /dev/mapper/mpath25
/dev/mapper/mpath25: size is 629145600 sectors
Setting devices/data_alignment to 0
Setting devices/default_data_alignment to 0
/dev/mapper/mpath25: Setting PE alignment to 128 sectors.
/dev/mapper/mpath25: Setting PE alignment offset to 0 sectors.
Opened /dev/mapper/mpath25 RW O_DIRECT
Wiping /dev/mapper/mpath25 at sector 8 length 8 sectors
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
Set up physical volume for "/dev/mapper/mpath25" with 629145600 available sectors
Scanning for labels to wipe from /dev/mapper/mpath25
Opened /dev/mapper/mpath25 RW O_DIRECT
/dev/mapper/mpath25: block size is 4096 bytes
Closed /dev/mapper/mpath25
Zeroing start of device /dev/mapper/mpath25
Opened /dev/mapper/mpath25 RW O_DIRECT
Wiping /dev/mapper/mpath25 at sector 0 length 4 sectors
/dev/mapper/mpath25: block

Last entry in the debug output indicating that the cause is in the zeroing first sector area.

To implement the solution, please execute the following steps:

1. For entire disk devices only the partition table must be erased, which will effectively destroy all data on that disk. This can be done by zeroing the first sector with:

# dd if=/dev/zero of= bs=512 count=1.

2. Perform pvcreate to create the physical volume:

# pvcreate [device]

3. Migrate the solution as appropriate to other environments.

Filed Under: CentOS/RHEL, CentOS/RHEL 6, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. How to add Swap Space on Linux Servers (CentOS/RHEL) On the Fly
  2. How to Customize Linux Password Expiration and Complexity Requirements
  3. How to enable bind query logging to find out Who’s Querying a Name Server
  4. How To Send Mails To an External User With Mailx on Linux
  5. How to Recover from a Corrupted or empty /etc/mtab file in CentOS/RHEL 7
  6. How to split iso or file using ‘split’ command in Linux
  7. Downloading a Specific Version of Package and Its Dependencies from Repository for Offline Installation Using YUM
  8. CentOS / RHEL : How to allow or deny Users to login to VSFTP Server
  9. Images preview with ngx_http_image_filter_module
  10. Linux OS service ‘auditd’

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright