• 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. dmidecode Command Examples in Linux
  2. CentOS / RHEL : anacron basics (What is anacron and how to configure it)
  3. Getting info with the vsish command (esxi only)
  4. Understanding The /etc/sysconfig Directory
  5. Images preview with ngx_http_image_filter_module
  6. How to allow or deny telnet login to specific users only in CentOS/RHEL
  7. Understanding /etc/security/limits.conf file
  8. How to Disable Daylight Savings Time (DST), and Modify the Timezone on Linux
  9. CentOS / RHEL 7 : How to boot into Rescue Mode or Emergency Mode
  10. idle3: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright