Linux不重启识别新添加的磁盘

现网的一台EXSI 下的虚拟机一般在进行配置变更后都会通过重启来识别新增的配置,不过业务侧某台主机因为业务需要无法重启,想通过不重启直接识别护容上去的新磁盘。经测试,发现如下方可以解决。

 

1、通过exsi 控制台为虚拟机新增磁盘

 

系统识别不到

 

2、执行如下命令扫盘

[root@server3 yum.repos.d]# echo "- - -" >  /sys/class/scsi_host/host0/scan


然后再运行fdisk -l 就能发现新添加的硬盘已经被系统识别了,查看系统日志/var/log/messages,发现对SCSI设备进行了一次重新扫描。需要注意的是echo的三个- – -号之间有空隔。
以下是执行结果: [root@server3
yum.repos.d]# fdisk -l Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos Disk identifier: 0x000a22fe Device Boot Start End Blocks Id System /dev/sda1 * 2048 2099199 1048576 83 Linux /dev/sda2 2099200 6293503 2097152 82 Linux swap / Solaris /dev/sda3 6293504 104857599 49282048 83 Linux Disk /dev/sdb: 17.2 GB, 17179869184 bytes, 33554432 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes

 

 

 

 

 

http://www.361way.com/linux-scan-newdisk/4683.html

 

posted @ 2018-09-29 14:12  LiShiChao  阅读(9496)  评论(1编辑  收藏  举报