今天在給服務器做LVM的時候(服務器的系統是CentOS 6.3),用fdisk分區之后,用w寫入分區表的時候,就提示
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.
退出fdisk之后,用partprobe直接通知內核重讀分區表,出現如下問題:
Warning: WARNING: the kernel failed to re-read the partition table on /dev/sda (設備或資源忙). As a result, it may not reflect all of your changes until after reboot.
嘗試用
partx -a /dev/sda
BLKPG: Device or resource busy
error adding partition 1
BLKPG: Device or resource busy
error adding partition 2
BLKPG: Device or resource busy
error adding partition 3
BLKPG: Device or resource busy
error adding partition 4
BLKPG: Device or resource busy
error adding partition 5
BLKPG: Device or resource busy
error adding partition 6
BLKPG: Device or resource busy
error adding partition 7
BLKPG: Device or resource busy
error adding partition 8
出現上面輸出。
解決方案:
假設新增的分區是/dev/sda9,那么執行partx -a /dev/sda9 /dev/sda就可以了,
試過partprobe; partprobe /dev/sda9(提示找不到此設備); partx -a /dev/sda(跟你提示的一樣)都不行,最后網上查到partx -a /dev/sda9 /dev/sda才成功,希望能可以提供給初學者參考。
