0

i was wondering if it was possible to cancel the rescan-scsi-bus.sh --forcerescan action after running it ? as far as i can see all it does is adds

echo 1 > /sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/rescan

Im assuming that this flag stays even after a server restart? would echoing a 0 (or "") to those files stop/cancel it?

I hope i explained correctly :-)

Romeo Ninov
  • 5,263
  • 4
  • 20
  • 26
txblx
  • 1

1 Answers1

0

Poking rescan is not the only thing rescan-scsi-bus.sh --forcerescan does. In force mode it will attempt to sync in flight writes, and remove and re-add devices. Poking the delete files of a device, similar to what you might do when removing a LUN from a live system. Per the warning in the usage message, this may be dangerous, try without it first.

No, this is not a configuration flag, as such. It is a way to tell the kernel to do something. On a restart, the kernel needs to scan the storage system anyway, so persisting it has no purpose.

I am not aware of any disable value for the sysfs knobs. Although this API is dreadfully obscure, I may be missing something. If your LUNs are not in a good state after a minute or two after issuing a rescan, doing it live may not be feasible. Stop applications using the disks, and reboot as cleanly as possible. By the time disks are not working, may be a bit late to do a backup of data, but do any recovery you need to.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34