"WARNING: Re-reading the partition table failed with error 16: Device or resource busy" in RHEL 7

Solution Unverified - Updated -

Issue

  • How to create a new partition in RHEL 7 without reboot ?
  • Disk /dev/sdX is being used for system partition, for example for /boot and / (root). How to create a new partion on it without rebooting the system.
  • While creating a new partition with fdisk command, following error is seen. However, partition gets created and could be used.
[root@hostname ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): p

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0004886a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    23570431    11272192   8e  Linux LVM

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Partition number (3,4, default 3): 3
First sector (23570432-41943039, default 23570432): 
Using default value 23570432
Last sector, +sectors or +size{K,M,G} (23570432-41943039, default 41943039): +2G
Partition 3 of type Linux and of size 2 GiB is set

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.
[root@hostname ~]# partprobe 
[root@hostname ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0004886a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    23570431    11272192   8e  Linux LVM
/dev/sda3        23570432    27764735     2097152   83  Linux

[root@hostname ~]# pvcreate /dev/sda3
  Physical volume "/dev/sda3" successfully created
[root@hostname ~]# pvs
  PV         VG               Fmt  Attr PSize  PFree
  /dev/sda2  rhel_hostname    lvm2 a--  10.75g 4.00m
  /dev/sda3                   lvm2 a--   2.00g 2.00g
  • For RHEL 6, when the above mentioned error is seen, the partition table was not read by partprobe.

Environment

  • Red Hat Enterprise Linux 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content