Skip to content

Instantly share code, notes, and snippets.

@DavidPesticcio
Last active September 28, 2017 19:40
Show Gist options
  • Save DavidPesticcio/e38a25dc8f45ef7866f3d04f9b91e499 to your computer and use it in GitHub Desktop.
Save DavidPesticcio/e38a25dc8f45ef7866f3d04f9b91e499 to your computer and use it in GitHub Desktop.
Linux: scan and activate new drives
#!/bin/bash
echo "Before scan:"
dmesg | awk '/scsi/ && /Direct-Access/'
for i in $(ls -d /sys/class/scsi_host/*); do echo "- - -" > $i/scan; done
echo "After scan:"
dmesg | awk '/scsi/ && /Direct-Access/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment