Problem
I have exported a new volume of 2TB from my SAN to a Linux server but after scanning and partitioning the disk when I tried to create the physical volume then I got the below error:
[root@server /]# pvcreate /dev/mapper/mpathlp1 Device /dev/mapper/mpathlp1 not found (or ignored by filtering). [root@server /]#
In general, this error may occur for any disk, like /dev/mapper/mpathxp1 when multipath is enabled.
multipath was enabled on my server I followed the steps given below:
Rescan of Disks
[root@server ~]# ls /sys/class/scsi_host host0 host1 host10 host11 host12 host2 host3 host4 host5 host6 host7 host8 host9 [root@server ~]# echo '- - -' > /sys/class/scsi_host/host0/scan [root@server ~]# echo '- - -' > /sys/class/scsi_host/host1/scan . . . . [root@server ~]# echo '- - -' > /sys/class/scsi_host/host12/scan
Status of Multipath Device
[root@server/]# multipath -ll mpathl
mpathl (360002ac0000000000600333800010b4b) dm-23 3PARdata,VV
size=2.0T features='0' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
|- 1:0:0:9 sdal 66:80 active ready running
|- 2:0:2:9 sdao 66:128 active ready running
|- 1:0:2:9 sdam 66:96 active ready running
`- 2:0:0:9 sdan 66:112 active ready running
[root@server /]#
Partitioning of the Disk
[root@server /]# fdisk /dev/mapper/mpathl
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x40457168.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
WARNING: The size of this disk is 2.2 TB (2199023255552 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
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): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-267349, default 3):
Using default value 3
Last cylinder, +cylinders or +size{K,M,G} (3-267349, default 267349):
Using default value 267349
Command (m for help): p
Disk /dev/mapper/mpathl: 2199.0 GB, 2199023255552 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 16777216 bytes
Disk identifier: 0x40457168
Device Boot Start End Blocks Id System
/dev/mapper/mpathlp1 3 267349 2147464777+ 83 Linux
Partition 1 does not start on physical sector boundary.
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@server /]#
Disk details after partitioning
[root@server ~]# fdisk -l /dev/mapper/mpathl
Disk /dev/mapper/mpathl: 2199.0 GB, 2199023255552 bytes
255 heads, 63 sectors/track, 267349 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 16777216 bytes
Disk identifier: 0x40457168
Device Boot Start End Blocks Id System
/dev/mapper/mpathlp1 3 267349 2147464777+ 83 Linux
Partition 1 does not start on physical sector boundary.
[root@server ~]#
Reason
I got the below warning while creating the partition for the disk /dev/mapper/mpathl which was the reason for the above error because the kernel was not able to read the updated partition table.
WARNING: Re-reading the partition table failed with error 22: Invalid argument. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) Syncing disks.
Solution
Re-reading of the partition table failed due to which system did not recognise the new partitions. As per the warning message, I run the command partprobe as shown below:
[root@server /]# partprobe
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (Device or resource busy). As a result, it may not reflect all of your changes until after reboot.
device-mapper: remove ioctl on mpathkp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathk (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathkp1part1-mpath-360002ac00000000001007c6f00010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathkp1 failed: Device or resource busy
device-mapper: remove ioctl on mpathjp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathj (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathjp1part1-mpath-360002ac00000000001003c5500010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathjp1 failed: Device or resource busy
device-mapper: remove ioctl on mpathep1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathe (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathep1part1-mpath-350002ac0002d1dfa failed: Device or resource busy
device-mapper: remove ioctl on mpathep1 failed: Device or resource busy
device-mapper: remove ioctl on mpathfp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathf (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathfp1part1-mpath-360002ac0000000000000003500010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathfp1 failed: Device or resource busy
device-mapper: remove ioctl on mpathgp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathg (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathgp1part1-mpath-360002ac0000000000000002e00010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathgp1 failed: Device or resource busy
device-mapper: remove ioctl on mpathbp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathb (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathbp1part1-mpath-360002ac0000000000000199500010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathbp1 failed: Device or resource busy
device-mapper: remove ioctl on mpathhp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathh (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathhp1part1-mpath-360002ac000000000000065c000010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathhp1 failed: Device or resource busy
device-mapper: remove ioctl on mpathdp1 failed: Device or resource busy
Warning: parted was unable to re-read the partition table on /dev/mapper/mpathd (Device or resource busy). This means Linux won't know anything about the modifications you made.
device-mapper: create ioctl on mpathdp1part1-mpath-360002ac0000000000000231000010b4b failed: Device or resource busy
device-mapper: remove ioctl on mpathdp1 failed: Device or resource busy
[root@server /]#
It’s taken some time to complete and after completion of the command, I tried to create the physical volume again and it becomes successful.
Create Physical Volume:
Create the Physical Volume using the command pvcreate.
[root@Server ~]# pvcreate /dev/mapper/mpathlp1
Physical volume "/dev/mapper/mpathlp1" successfully created
Create Volume Group:
Create the Volume Group using the command vgcreate.
[root@Server ~]# vgcreate vglsupload /dev/mapper/mpathlp1
Volume group "vglsupload" successfully created
See the Details of the Volume Group:
See the details of the Volume Group using the command vgdisplay.
[root@Server ~]# vgdisplay -v vglsupload
Using volume group(s) on command line.
--- Volume group ---
VG Name vglsupload
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.00 TiB
PE Size 4.00 MiB
Total PE 524279
Alloc PE / Size 0 / 0
Free PE / Size 524279 / 2.00 TiB
VG UUID Fofe00-kE3G-4fqF-lM6K-BmsF-9EbC-Dp24Rs
--- Physical volumes ---
PV Name /dev/mapper/mpathlp1
PV UUID oxBcA0-L3ws-BJGy-dA0T-EyWv-37j7-2RtVoz
PV Status allocatable
Total PE / Free PE 524279 / 524279
Create Logical Volume:
Now create the Logical Volume using the command lvcreate.
[root@Server ~]# lvcreate 524278 -n lvlsupload vglsupload
Logical volume "lvlsupload" created.
[root@Server ~]# vgdisplay -v vglsupload
Using volume group(s) on command line.
--- Volume group ---
VG Name vglsupload
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 2.00 TiB
PE Size 4.00 MiB
Total PE 524279
Alloc PE / Size 524278 / 2.00 TiB
Free PE / Size 1 / 4.00 MiB
VG UUID Fofe00-kE3G-4fqF-lM6K-BmsF-9EbC-Dp24Rs
--- Logical volume ---
LV Path /dev/vglsupload/lvlsupload
LV Name lvlsupload
VG Name vglsupload
LV UUID YzR7kD-1FyW-SEoa-SCk1-eZDR-zQVg-se7Scv
LV Write Access read/write
LV Creation host, time UTILITY, 2018-12-07 17:44:33 +0530
LV Status available
# open 0
LV Size 2.00 TiB
Current LE 524278
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:25
--- Physical volumes ---
PV Name /dev/mapper/mpathlp1
PV UUID oxBcA0-L3ws-BJGy-dA0T-EyWv-37j7-2RtVoz
PV Status allocatable
Total PE / Free PE 524279 / 1
Format the Volume:
Format the volume in ext4 file format
[root@Server ~]# mkfs.ext4 /dev/vglsupload/lvlsupload
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=4 blocks, Stripe width=4096 blocks
134217728 inodes, 536860672 blocks
26843033 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
16384 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848, 512000000
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 20 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
Create a mount point and mount:
Create a mount point directory and mount the formatted volume to this directory.
[root@Server ~]# mkdir /lsupload [root@Server ~]# mount /dev/vglsupload/lvlsupload /lsupload [root@Server ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vglsupload-lvlsupload 2.0T 71M 1.9T 1% /lsupload
Note: I have faced and resolved this issue on RHEL 6.8
Related Posts
- Create PV, VG, LV and format it in Linux when Multipath Enabled
- Create a Logical Volume larger than 2TB and format it in Linux/RHEL
- Create a Logical Volume and format it in HP-UX
- Create a Logical Volume larger than 2TB and format it in HP-UX
Last Updated: December 11, 2018