关于Vmware虚拟机或物理机添加新磁盘后-Linux系统不能立即识别的解决方法

发布时间 2023-07-07 14:41:19作者: 520_1351

本文主要描述如何解决Vmware虚拟机或物理机添加新磁盘后-Linux系统不能立即识别的解决方法,其中的环境说明:

服务器:Vmware虚拟机 或 物理机

操作系统:Linux 操作系统

在工作中,有时我们会遇到如下一种情况,就是在对Vmware虚拟机外部添加了一块磁盘

然后我们登录到Linux系统中却发现不了新的磁盘,解决方法一般有如下两种

1、重启Linux操作系统(对于生产环境,就不是很推荐了)

2、通过在Linux操作系统中,刷新扫描scsi host 设备

这里笔者讲一下第2种方式的操作过程

1、刷新扫描scsi设备和,如果没有出结果,可以继续host3,host4,直到操作系统中能够识别出新添加的磁盘

[root@qq-5201351 ~]# echo "- - -" > /sys/class/scsi_host/host0/scan
[root@qq-5201351 ~]# echo "- - -" > /sys/class/scsi_host/host1/scan
[root@qq-5201351 ~]# echo "- - -" > /sys/class/scsi_host/host2/scan

对命令的解释:

This is the same command as described in Section 25.11, “Adding a Storage Device or Path” to add a storage device or path. In this case,

however, the channel number, SCSI target ID, and LUN values are replaced by wildcards. Any combination of identifiers and wildcards is allowed,

so you can make the command as specific or broad as needed. This procedure adds LUNs, but does not remove them.


详情也可以参考如下资料,也有进行详细的更多的说明:
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/scanning-storage-interconnects

 

 

 

尊重别人的劳动成果 转载请务必注明出处:https://www.cnblogs.com/5201351/p/17534907.html