Last active
August 29, 2015 13:56
-
-
Save thehaven/8801222 to your computer and use it in GitHub Desktop.
Simple way to detect whether a drive is a spindle or not.
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
#!/bin/bash | |
# pass the drive argument to this script when calling i.e. ./script.sh sda | |
# see: http://www.mjmwired.net/kernel/Documentation/block/queue-sysfs.txt for other parameters | |
if [ "$( find /sys -name rotational | grep $0 | xargs cat )" ]; then | |
echo "its a spinny!" | |
else | |
echo "its an SSD or Flash!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment