Is there anyway (kernel command line, hdparm argument) to force the hard drive on my laptop to NEVER go into powersaving mode, even after reboot? In whatever default mode it's in, it's just horribly slow ('ls' takes 3-4 seconds to run, no matter the situation. X/XFCE takes almost 2 (!) minutes to start if I forget to kill the powersaving first.) 'hdparm -B 255 /dev/sda' fixes the matter. But getting to a terminal takes forever w/the powersaving on and it's annoying as hell. Systemd, unfortunately, provides no /etc/rc.local functionality, but even so, I'd rather kill the powersaving far earlier in the boot than that anyway. -k/K options to hdparm don't work (inappropriate ioctl), to save settings between boots... Any ideas?
Create your own service file that runs with local-fs-pre.target or local-fs.target?
Edit: See man bootup to find a suitable point in the bootup tree
Last edited by progandy (2012-08-31 14:05:25)
I'm also interested in this!
Maybe this is what you're after https://aur.archlinux.org/packages.php?ID=63119
I made a udev rule for my Momentus XT. When the make and model of my Momentus XT is detected, I have udev run a quick "# hdparm -B 240 /dev/disk/by-id/XXXXX" (I picked 240 randomly because it is high, but not quite max...)
But these rules are not persistent between suspends/hibernates. So I use /lib/systemd/system-sleep to run a script to reinstate the settings I had earlier. I could have determined the previous level, stored it and reinstated that specific level. But I was lazy and figured I would just stick with 240 all the time. So my script basically tests to see if /dev/disk/by-id/XXXX exists, and if it does, it simply runs the same hdparm command as udev on wake.
don't create systemd service. proper way would be to use udev rules in /etc/udev/rules.d, here is example for your sata or scsi drive
ACTION=="add", KERNEL=="sda", RUN+="/sbin/hdparm -B 254 /dev/sda"
Thanks to all now it works!
I've created the file 10-local.rules with the suggested code and everything works as expected !!
Last edited by Preycon (2012-10-05 06:20:29)