使用Bash Script在rhel7中扫描新添加的磁盘


0

任何人都可以帮我,在单个bash脚本中扫描新添加的硬盘吗?

我的意思是说如何在单个脚本中扫描多个主机。即host0 / scan,host1 / scan,host2 / scan ......

#!/bin/bash

SCRIPT NO.1

a=33
for ((b=0;a>b;b=$b+1))
do
echo $b
host=$b
echo "- - -" > /sys/class/scsi_host/host/scan
done


# SCRIPT NO.2

host=i
for i in 1 2 3 4 5
do
echo "- - -" > /sys/class/scsi_host/host0/scan
done

是的,我尝试了两次尝试。其实我的问题是如何扫描每个主机(echo“ - - - ”/ sys / class / scsi_host / host0 / scan,echo“ - - - ”/ sys / class / scsi_host / host0 / scan,...... .... host30 ....)使用单个bash脚本,在添加新磁盘后,物理上像sdb,sdc,sdd等?
拉赫曼法鲁克

是的,我想运行bash脚本来扫描主机。
rahman farook

嗨Davidpostill,如何在CentOS 7 / RHEL 7上重新启动时添加新硬盘?
拉赫曼法鲁克
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.