Skip to content

Instantly share code, notes, and snippets.

@thehaven
thehaven / ssd check
Last active August 29, 2015 13:56
Simple way to detect whether a drive is a spindle or not.
#!/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
@thehaven
thehaven / zfs-build.sh
Last active May 16, 2021 06:09
ZFS kernel module build script (assumes /usr/src/linux for kernel path), useful for patching a kernel with ZFS code
#!/bin/bash
current=`pwd`
#branch='0.6.5.8'
#zfs_commit='cb2e3360380ad465c2e5685941ae125b5cff463a' # OpenZFS 2.1.0-rc5
#zfs_commit='6150fbe67f7a9485eaabbca7df9a66852cda6892' # OpenZFS 2.0.4
function prep_and_clean() {
cd /usr/src/linux && make prepare
rm -Rf ${current}/spl ${current}/zfs