USB HDD spindown

Raspberry Pi related support

USB HDD spindown

Postby leeshep » 29 May 2015, 21:16

Hi,

Can someone please help me configure my USB hard drive to spindown when not in use. I really don't think it's doing it any good running all the time.

Thanks

Lee
Ps I'm using beta 0.3 on a rpi2
leeshep
 
Posts: 10
Joined: 27 Apr 2015, 18:45

Re: USB HDD spindown

Postby hondagx35 » 29 May 2015, 21:35

Hi Lee,

as far as i know hdparmis the only thing that works.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: USB HDD spindown

Postby leeshep » 02 Jun 2015, 20:26

Thanks Frank,

That looks like just the ticket. Can you give me an idiots guide to how to install and run it please?

Many thanks.

Lee
leeshep
 
Posts: 10
Joined: 27 Apr 2015, 18:45

Re: USB HDD spindown

Postby Tinitus » 02 Jun 2015, 20:50

Hi Lee,

I did the following:

Code: Select all
Pacman -S hdparm


installed the package and then

Code: Select all
hdparm -S /dev/sda


answer was

Code: Select all
bad/missing stanby interval value (0..255)


positive thinker that I am I did

Code: Select all
hdparm -S 60 /dev/sda


got the answer

Code: Select all
/dev/sda:
setting standby to 60 (5 minutes)


did

Code: Select all
hdparm -S /dev/sda


again answer was

Code: Select all
bad/missing stanby interval value (0..255)


but now after approximately 5 min HHD spun down

Maybe after reboot

Code: Select all
hdparm -S /dev/sda


would have given the right answer

First time I tried it, it did not work at all

probabaly because when the HDD was hooked up to the W7 laptop the last time I had energy saving (spin down) disabled altogether.

Enjoy

Tinitus
Tinitus
 
Posts: 79
Joined: 20 Mar 2015, 20:53

Re: USB HDD spindown

Postby Tinitus » 03 Jun 2015, 21:07

Hi,

Just found out that the installation seems to forget the setting. Today no spin down. When I queried the settings, I got the bad/missing standby value .. message. I had to redo

Code: Select all
hdparm -S 60 /dev/sda


and only then the HDD spun down after approximately 5 minutes.

Any possibility to make the change permanent?

Regards

Tinitus
Tinitus
 
Posts: 79
Joined: 20 Mar 2015, 20:53

Re: USB HDD spindown

Postby hondagx35 » 03 Jun 2015, 21:57

Hi Tinitus,

the best way is to use udev like described here.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: USB HDD spindown

Postby Tinitus » 04 Jun 2015, 20:28

Hi Frank,

:oops: should have read the whole page. I still have one question. I did what is written on that page, I edited
Code: Select all
/etc/udev/rules.d/50-hdparm.rules

ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 255 -S 60 /dev/sda"


-B 255 because this disables APM and -S 60 for spin down after 5 minutes

but that does not work

I presume that RUN+= ...... should start hdparm yet when I run top it is not listed as a task
may it be that /usr/bin/hdparm is simply the wrong path and that is the reason why it does not work?
I installed hpparm via pacman -S and I have not got the slightest clue of the path it gets installed to.

Or the other suspicion I have is that -B 255 disables APM and the spin down is included in the APM?

I will try to omit -B from the udev rule although I do not know whether that is possible

Best Regards

Tinitus
Tinitus
 
Posts: 79
Joined: 20 Mar 2015, 20:53

Re: USB HDD spindown

Postby Tinitus » 04 Jun 2015, 20:59

Hi,

omiting the -B option from the udev rule did not solve the problem, it still does not work.
Starting hdparm and setting the spin down to 5 min works fine. I guess the problem with the udev rule is either the path to hdparm or the fact that hdparm does not belong to the correct user group or something like that.

Regards

Tinitus
Tinitus
 
Posts: 79
Joined: 20 Mar 2015, 20:53

Re: USB HDD spindown

Postby hondagx35 » 04 Jun 2015, 21:29

Hi Tinitus,

Code: Select all
/usr/bin/hdparm

Should be the right path.
You can find the path by:
Code: Select all
which hdparm


- is sda the right device?
- is this
Code: Select all
/etc/udev/rules.d/50-hdparm.rules

part of your file?

should start hdparm yet when I run top it is not listed as a task

hdparm runs only for a very short time, so you can see it in top.

I tried this "/etc/udev/rules.d/50-hdparm.rules"
Code: Select all
ACTION=="add", SUBSYSTEM=="block", KERNEL=="sda", RUN+="/usr/bin/hdparm -B 255 -S 60 /dev/sda"

and it works without problems.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: USB HDD spindown

Postby Tinitus » 04 Jun 2015, 22:58

Hi Frank,

so it does in my installation, too now. I realise that using GUI for a long time cripples ones attention to details, if there is only a virtual button to press, the mouse pointer leaves some margin, is you forget " at the end of a command line it just does not work.

Thanks for your help

Tinitus
Tinitus
 
Posts: 79
Joined: 20 Mar 2015, 20:53

support RuneAudio Donate with PayPal

Next

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 2 guests