Sunday, July 6, 2014

fdisk warning - WARNING: Re-reading the partition table failed with error 22: Invalid argument

What is correct way to create partition on a multipath device?


# fdisk /dev/mapper/mpath99
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): Command action
   e   extended
   p   primary partition (1-4)
Partition number (1-4): First cylinder (1-130541, default 1): Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-130541, default 130541): Using default value 130541

Command (m for help): 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.
Syncing disks.

# kpartx -a -v /dev/mapper/mpath99  ( RHEL <6 span="">
    OR
# kpartx -a -p p -v /dev/mpath99 ( RHEL >=6)
# fdisk -l /dev/mapper/mpath99


Why is show warning - WARNING: Re-reading the partition table failed with error 22: Invalid argument?

cause of above warning is - multipath device maps (i.e. mpathX devices) is in use in device-mapper tables, kernel would not be able to re-read partition table of devices. It is safe to ignored. Ensure to run "kpartx" command with multipath devices after creating partition.


What to create single partition on whole disk quickly of thru script?

# echo -e 'n\np\n1\n\n\nw'  | fdisk /dev/mapper/mpath99

Refer : "How can I create partitions on multipath devices in RHEL?"  & fdisk warning

No comments:

Post a Comment