虛擬機新增硬盤,如何讓Linux系統識別到?
下面來說說兩種方式,讓Linux系統識別到新增硬盤:
1、重啓系統(不用動腦就搞定)
有人說,我比較懶,不想動腦,那麼這種方法(重啓系統,一切搞定)很適合你。
那麼,萬一要是此Linux系統有業務正在運行,而又不能重啓呢?咋辦,這時就要動手+動腦了。
出絕招了,請看下面方法。
2、執行命令,重新scan設備
#先cd到/sys/class/scsi_host/目錄
[root@ilinux /]# cd /sys/class/scsi_host/
#我們來看看scsi_host目錄有啥東西呢,這裏有三個子目錄哦
[root@ilinux scsi_host]# ls host0 host1 host2
#執行如下命令
[root@ilinux scsi_host]# echo "- - -" > host0/scan 注意:“- - -”這三個“-”中間有空格滴。
#用fdisk命令來查看下吧
[root@ilinux scsi_host]# fdisk -l
#如果還是沒有識別到,彆着急,go on;
[root@ilinux scsi_host]# echo "- - -" > host1/scan [root@ilinux scsi_host]# echo "- - -" > host2/scan#我們再分別執行下上面host1和host2的命令,再fdisk下吧!
[root@ilinux scsi_host]# fdisk -l Disk /dev/sda: 171.8 GB, 171798691840 bytes 255 heads, 63 sectors/track, 20886 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: 0x000d1499 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 281 2048000 82 Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 281 20887 165518336 83 Linux Disk /dev/sdb: 64.4 GB, 64424509440 bytes 255 heads, 63 sectors/track, 7832 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#到這裏我們可以看到除了Disk /dev/sda: 171.8 GB,還出現了一個Disk /dev/sdb: 64.4 GB。這樣就OK了,開始在新磁盤上該幹嘛就幹嘛吧。