Skip to content

Instantly share code, notes, and snippets.

@orymate
Created November 20, 2015 10:01
Show Gist options
  • Save orymate/c3fe78a40c08358d91ff to your computer and use it in GitHub Desktop.
Save orymate/c3fe78a40c08358d91ff to your computer and use it in GitHub Desktop.
/usr/local/sbin/rescan-scsi:
file.managed:
- mode: 755
- contents: |
#!/bin/bash
echo Before:
awk '/sd/{print $4, int(int($3)/1024/1024) "G"}' /proc/partitions
# find new devices
echo "- - -" | tee /sys/class/scsi_host/host*/scan
# rescan disk sizes (detect extension)
echo 1 | tee /sys/class/scsi_device/*/device/rescan
echo After:
awk '/sd/{print $4, int(int($3)/1024/1024) "G"}' /proc/partitions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment