--- a/etc/init.d/hdparm 2012-12-24 00:32:51.375277569 +0100 +++ a/etc/init.d/hdparm 2012-12-24 00:32:55.435277497 +0100 @@ -43,11 +43,27 @@ case ${errmsg} in *": No medium found") nomed=0;; esac + args="" if [ -b "${device}" ] && [ "${status}" = "0" -o "${nomed}" = "0" ] ; then local conf_var="${device##*/}_args" eval args=\$${conf_var} - do_hdparm fi + + # allows a disk to be configured using its id (override above) + # we replace all dashes by underscores + for alias in /dev/disk/by-id/* ; do + if [ "${alias}" -ef "${device}" ] ; then + eval args_tmp=\$"$(basename "${alias}" | sed 's/-/_/g')"_args + if [ -n "${args_tmp}" ]; then + args="${args_tmp}" + fi + break + fi + done + + if [ -n "$args" ]; then + do_hdparm + fi; done }