Linux – Ubuntu seems to ignore spindown_time in config /etc/hdparm.conf

hdparmlinuxUbuntu

I have /etc/hdparm.conf configured to power down the external USB HDD, but it actually never spins down. When I manually turn it off (hdparm -Y or set its spindown hdparm -S 36) – everything works as expected.

It seems like my Ubuntu ignores /etc/hdparm.conf on reboot 🙁 Here's some useful info:

# blkid
/dev/sde6: LABEL="BACKUP-HDD" UUID="fee45c66-11bd-49fa-a62a-4a541716e8e1" TYPE="ext2"

# ls -lh /dev/disk/by-label
lrwxrwxrwx 1 root root  10 2009-10-19 05:59 BACKUP-HDD -> ../../sde6

# cat /var/log/dmesg /var/log/messages | grep hdparm


# tail -n 4 /etc/hdparm.conf
/dev/disk/by-label/BACKUP-HDD {
    apm = 20
    spindown_time = 36
    standby
    }

Any suggestions how to troubleshoot this?

UPD: launching sudo /lib/udev/hdparm seems to re-read /etc/hdparm.conf, but has no effect: HDD is still spinning.

Best Answer

There are at least two problems here.

The first one is that the script /lib/udev/hdparm that parses /etc/hdparm.conf expects that the name of the device to be configured is in environment variable $DEVNAME in the same form as it is in configuration file. The udev rule, at least in 9.04, specifies that the device name is of form [sh]d[a-z]. Of course, since the device name depends on other plugged-in drives, this is quite useless. The bug report has been open for a while: https://bugs.launchpad.net/ubuntu/+source/hdparm/+bug/222458

Another problem in the setup is that the udev script seems to be never called for SATA drives.