1、查看硬盘
[root@linux-host1 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 20G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 19G 0 part ├─centos-root 253:0 0 17G 0 lvm / └─centos-swap 253:1 0 2G 0 lvm [SWAP] sr0 11:0 1 1G 0 rom
# 没有检查到sdb的硬盘
2、查看当前系统有多少个host目录
[root@linux-host1 ~]# ls /sys/class/scsi_host/ -l total 0 lrwxrwxrwx. 1 root root 0 Sep 16 12:42 host0 -> ../../devices/pci0000:00/0000:00:10.0/host0/scsi_host/host0 lrwxrwxrwx. 1 root root 0 Sep 16 12:42 host1 -> ../../devices/pci0000:00/0000:00:07.1/ata1/host1/scsi_host/host1 lrwxrwxrwx. 1 root root 0 Sep 16 12:42 host2 -> ../../devices/pci0000:00/0000:00:07.1/ata2/host2/scsi_host/host2
3、有多少个host就往多少个host目录里面文件scan追加"- - -"
[root@linux-host1 ~]# echo "- - -"> /sys/class/scsi_host/host0/scan [root@linux-host1 ~]# echo "- - -"> /sys/class/scsi_host/host1/scan [root@linux-host1 ~]# echo "- - -"> /sys/class/scsi_host/host2/scan
4、再次检查硬盘是否已经识别到
[root@linux-host1 ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 20G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 19G 0 part ├─centos-root 253:0 0 17G 0 lvm / └─centos-swap 253:1 0 2G 0 lvm [SWAP] sdb 8:16 0 20G 0 disk <<已经识别成功 sr0 11:0 1标签:..,重启,linux,host,host1,Linux,scsi,root,硬盘 From: https://www.cnblogs.com/cf211/p/18186725