#!/bin/sh
# Set on noop scheduler for hdds with NCQ
for D in /sys/block/sd?; do
S=$D/queue/scheduler
Q=$D/device/queue_depth
if [[ "$(cat $Q)" == "31" ]]; then
echo $D: $(cat $S) - set schedule to noop
echo noop > $S
fi
done