大网数据广告活动
服务器运维问答

What is the purpose of /sys/block/sd?/device/rescan?

· 52CE 我爱测

I need to "rescan" the SATA bus of our Linux server in search of a hotplug device that doesn't show up. I've seen an old question on the topic ( How do I make Linux recognize a new SATA /dev/sda drive I hot swapped in without reb…

问题原文

原帖链接 · Sylvain Leroux · CC BY-SA 4.0

I need to "rescan" the SATA bus of our Linux server in search of a hotplug device that doesn't show up. I've seen an old question on the topic (How do I make Linux recognize a new SATA /dev/sda drive I hot swapped in without rebooting?) and the information given there did work.

However, I also noticed there was a rescan entry in /dev/block/sd?/device.

So, can I assume the following:

echo 1 > /sys/block/sdd/device/rescan

would be equivalent to:

echo 1 > /sys/block/sdd/device/delete
echo "- - -" > /sys/class/scsi_host/host4/scan

已采纳解答

原帖链接 · user9517 · CC BY-SA 4.0

Strictly speaking they are not equivalent but they may achieve the same outcome.

The first command requests the system rescan the specified device for changed device parameters.

The second command deletes the specified device and rescans the SCSI subsystem for new devices and reads their parameters. It's possible then, that additional changes not related to the specific device may occur.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2021-01-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。