2

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
Sylvain Leroux
  • 175
  • 1
  • 8

1 Answers1

4

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.

user9517
  • 114,104
  • 20
  • 206
  • 289
  • Thanks for the reply. In my case, since I physically replaced the disk, would the first command have worked at discovering the _new_ device? FWIW, with the second command, the new disk was identified as /dev/sdg, not as /dev/sdd like the original one was. – Sylvain Leroux Jan 07 '21 at 12:58