增加磁盘不重启虚拟机识别磁盘

[root@localhost opt]# ls /sys/class/scsi_host/ 

host0 host1 host2
[root@localhost opt]#
[root@localhost opt]#
[root@localhost opt]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@localhost opt]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@localhost opt]# echo "- - -" > /sys/class/scsi_host/host2/scan
[root@localhost opt]#
[root@localhost opt]#
[root@localhost opt]# ls /sys/class/scsi_device/
0:0:0:0 1:0:0:0 2:0:0:0 2:0:1:0 2:0:2:0
[root@localhost opt]#
[root@localhost opt]#
[root@localhost opt]# echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
[root@localhost opt]# echo 1 > /sys/class/scsi_device/1\:0\:0\:0/device/rescan
[root@localhost opt]# echo 1 > /sys/class/scsi_device/2\:0\:0\:0/device/rescan
[root@localhost opt]# echo 1 > /sys/class/scsi_device/2\:0\:1\:0/device/rescan
[root@localhost opt]# echo 1 > /sys/class/scsi_device/2\:0\:2\:0/device/rescan

posted @ 2018-04-20 17:01  凉生墨客  阅读(265)  评论(0编辑  收藏  举报