Last active
December 25, 2024 23:16
-
-
Save stefanthoss/ea4cd612c0050e5e4bc18bc063b3ddc9 to your computer and use it in GitHub Desktop.
This script checks the standby status of disks in a FreeBSD system (e.g. FreeNAS). It can be used to check whether disks are spinning down properly. For each SATA and IDE hard drive, it will return either standby (0x00) or active/idle (0xff). The script needs to be run as root.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DEVICES=$(camcontrol devlist | sed 's/.*,\(.*\)).*/\1/') | |
for DEV in $DEVICES; do | |
printf "%s: " "$DEV" | |
camcontrol epc "$DEV" -c status -P | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment