vmware新加磁盤fdisk看不到的處理


虛擬機硬盤空間不夠了,做了lvm准備加塊硬盤擴容,在vcenter控制台加了磁盤,結果操作系統里面fdisk -l看不到新加的硬盤,又不想重啟怎么辦,一條命令就可以搞定。

# 注意中間有空格
echo "- - -" >  /sys/class/scsi_host/host0/scan



[root@web03_back:/data]# 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@web03_back:/data]# echo "- - -" >  /sys/class/scsi_host/host
host0/ host1/ host2/
[root@web03_back:/data]# echo "- - -" >  /sys/class/scsi_host/host0/scan
[root@web03_back:/data]# echo "- - -" >  /sys/class/scsi_host/host1/scan
[root@web03_back:/data]# echo "- - -" >  /sys/class/scsi_host/host2/scan
[root@web03_back:/data]# 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


再用fdisk -l就看到了
當然是host0還是host1,…,具體應該跟加硬盤時選擇的掛載點有關系,不清楚就逐個試一遍好了


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM