CentOS新加磁盤fdisk看不到解決

測試環(huán)境硬盤不夠用了,做了lvm新插了塊硬盤擴容,結(jié)果在系統(tǒng)里 fdisk -l 卻看不到新加的硬盤,又不想重啟怎么辦?

[root@owner-node1:~]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000387ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        1046     8192000   82  Linux swap / Solaris
/dev/sda3            1046       65271   515890176   83  Linux

一條命令就可以搞定:

# 注意“- - -”中間有空格
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host0/scan
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host1/scan
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host2/scan
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host3/scan
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host4/scan
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host5/scan
[root@owner-node1:~]# echo "- - -" >  /sys/class/scsi_host/host6/scan

再用 fdisk -l 就看到了

[root@owner-node1:~]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000387ab

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              26        1046     8192000   82  Linux swap / Solaris
/dev/sda3            1046       65271   515890176   83  Linux

Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

其中是host0還是host1…,跟新插入的硬盤口有關(guān)系,不清楚就逐個試一遍好了

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容