This error may occur when mkfs. ext4/dev/sda2 is used to format the hard disk space.
Had this situation at office where I was told to re-partition an already existing partition. The situation was to get the below schema
/Dev/sdb1 1 3040 24418768 + 83 Linux
/Dev/sdb2 3041 6080 24418800 83 Linux
/Dev/sdb3 6081 30515 196274137 + 83 Linux
To
/Dev/sdb1 1 3040 24418768 + 83 Linux
/Dev/sdb2 3041 6080 24418800 83 Linux
/Dev/sdb3 6081 30515 196274137 + 5 Extended
/Dev/sdb5 6081 18239 97667136 83 Linux
/Dev/sdb6 18240 30515 98606938 + 83 Linux
Alright, now the partition/dev/sdb2 was in use and cannot be unmounted. So what happens when you finish the partitioning with fdisk?
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.
Syncing disks.
This happends, if you are using/mounted any partitions of the HDD which you just re-partitioned. normally we do reboot the machine to get this right. but this is not always the easy way out, when you have something running on the machine/multiple users are on the machine working etc. so there comes the "parted" for rescue.
The package "parted" provides a tool called "partprobe". this will do the magic for you, you just type in the command (see the man page for more info on partprobe) and this will give the information needed about your newly created partition to your kernel.
Solution: run the partprobe command.
Partprobe is included in the rpm package of parted. Partprobe can modify the partition table in the kernel so that the kernel can read the partition table again. Therefore, you can use this command to create partitions that the system can recognize without restarting the machine.
Check whether the command is installed:
[Root @ db1 dev] # rpm-q parted
Parted-1.8.1-23.el5
Run the following command:
[Root @ db1 dev] # partprobe
Warning: Unable to open/dev/hdc read-write (Read-only file system)./dev/hdc has been opened read-only.
If there are still errors, you can see from the error that you need to reboot and restart and then mkfs format the hard disk space.