Skip to content

Instantly share code, notes, and snippets.

@pad92
Created April 15, 2019 12:12
Show Gist options
  • Save pad92/f0d75acf54b7eabe966a948d0caeda1d to your computer and use it in GitHub Desktop.
Save pad92/f0d75acf54b7eabe966a948d0caeda1d to your computer and use it in GitHub Desktop.
rescan disk
#!/bin/sh
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