Disk Extended Error: WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

Error:

when formatting the partition of the Linux extended disk, if an error is reported:
warning: failed to re read the partition table, error 16: the device or resource is busy.

[[email protected] host0]# fdisk /dev/sda -l

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 16: Device or resource busy.
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:

Sync.
centos6
[[email protected] ~]# partprobe /dev/sdb # centos6 has bugs that don't work well
[[email protected] ~]# partx -a /dev/sdb # Add partition
[[email protected] ~]# partx -d --nr 5-7 /dev/sdb # -d delete partition, --nr 6 specify range

centos5,7:
partprobe

 

Read More: