Problem
I have added a new disk to the Linux server but after creating the partition using fdisk command, the partitioned disk was not found, as shown below:
[root@DbAppWeb ~]# fdisk /dev/mapper/mpathq
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x2b725bda.
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: 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-133674, default 3):
Using default value 3
Last cylinder, +cylinders or +size{K,M,G} (3-133674, default 133674):
Using default value 133674
Command (m for help): p
Disk /dev/mapper/mpathq: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 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: 0x2b725bda
Device Boot Start End Blocks Id System
/dev/mapper/mpathqp1 3 133674 1073720340 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@DbAppWeb ~]#
When I tried to list the partitioned disk, it’s showing the message No such file or directory
[root@DbAppWeb ~]# ll /dev/mapper/mpathqp1
ls: cannot access /dev/mapper/mpathqp1: No such file or directory
[root@DbAppWeb ~]#
Reason
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)
Solution
Run the partprobe command to read the partitioned table.
[root@DbAppWeb ~]# partprobe /dev/mapper/mpathqp1
Now, the partitioned disk is accessible and you may proceed further with PV, VG and LV creation.
[root@DbAppWeb ~]# ll /dev/mapper/mpathqp1
lrwxrwxrwx. 1 root root 8 Jan 15 10:37 /dev/mapper/mpathqp1 -> ../dm-29
[root@DbAppWeb ~]#
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
Last updated: August 19, 2019