1. 程式人生 > >WARNING Re-reading the partition table failed with error 16

WARNING Re-reading the partition table failed with error 16

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!http://blog.csdn.net/jiangjunshow

也歡迎大家轉載本篇文章。分享知識,造福人民,實現我們中華民族偉大復興!

               

在 mkfs.ext4 /dev/sda2 格式化硬碟空間時,可能出現這樣的錯誤。

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.


解決方法:執行下partprobe 命令

 

       partprobe包含在parted的rpm軟體包中。partprobe可以修改kernel中分割槽表,使kernel重新讀取分割槽表。 因此,使用該命令就可以建立分割槽並且在不重新啟動機器的情況下系統能夠識別這些分割槽

 

檢視是否安裝該命令:

[[email protected] dev]# rpm -q parted

parted-1.8.1-23.el5

 

我們執行一下該命令:

[[email protected] dev]# partprobe

Warning: Unable to open /dev/hdc read-write (Read-only file system).  /dev/hdc has been opened read-only.

如果還有錯誤,可以從錯誤中看出來,需要reboot重啟然後再mkfs格式化硬碟空間就可以了。

           

給我老師的人工智慧教程打call!http://blog.csdn.net/jiangjunshow

這裡寫圖片描述