Linux Rescan SCSI Bus

Linux Rescan SCSI Bus

Published August 22, 2012 • Updated January 10, 2019


If you have added one to many disks to a Linux server or added partitions to an existing disk and the operating system has not yet recognized them, you might need to rescan the SCSI bus. You could simply reboot the Linux server, but that's usually not an option for production systems.

Below are three different methods for rescanning SCSI devices that I have tested on RHEL 5 and RHEL 6.

Rescan Specific SCSI Device

This command consistently rescanned the specific SCSI device.

Replace $DEVICE with sda, sdb, sdc, etc.

echo 1 > /sys/block/$DEVICE/device/rescan

Rescan Entire Host SCSI Bus

This command never consistently rescanned the host SCSI bus.

Replace $HOST with the SCSI host you want to scan which could be host0host1host2, etc. Typically $HOST is host0.

echo "- - -" > /sys/class/scsi_host/$HOST/scan

The triple dashes, - - -, are wildcards that rescan every channel, every target, and every LUN on the specified SCSI host.

Rescan Specific SCSI Device (Deprecated)

This command never consistently rescanned the specific SCSI bus, and it has been deprecated by Red Hat.

Host:Bus:Target:LUN (0:0:2:0 in this example) might be different for your system. Run ls -al /dev/disk/by-path to find it.

echo "scsi remove-single-device 0:0:2:0" > /proc/scsi/scsi
echo "scsi add-single-device 0:0:2:0" > /proc/scsi/scsi
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值