Skip to content

Instantly share code, notes, and snippets.

@pad92
Last active May 9, 2026 23:12
Show Gist options
  • Select an option

  • Save pad92/f0d75acf54b7eabe966a948d0caeda1d to your computer and use it in GitHub Desktop.

Select an option

Save pad92/f0d75acf54b7eabe966a948d0caeda1d to your computer and use it in GitHub Desktop.
rescan disk
#!/bin/sh
# Details on https://notes.depad.fr/2010/03/comment-detecter-un-disque-ou-un-lun-a-chaud/
for FC in $(ls /sys/class/fc_host/host*/issue_lip); do echo 1 > "${FC}"; done # rescan fiberchanel
for SCAN in $(ls /sys/class/scsi_host/host*/scan); do echo "- - -" > "${SCAN}"; done # scan new disk
for RESCAN in $(ls /sys/class/scsi_device/*/device/rescan); do echo 1 > "${RESCAN}"; done # scan disk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment