Gilder
Posts: 5
Joined: Fri Oct 18, 2019 8:43 pm

External hard drives that no longer standby under rasbian buster

Sat Oct 19, 2019 7:16 pm

Good evening, I use a RPI 3b+ like nas with 3 hard drives connected in USB and where each disc is in a box which is supposed to extinguish automatically the disc after 10 minutes of inactivity. Everything worked well before, but since the passage to raspian 10, it does not seem to work, and I hear all the time the discs turn any time of the day. An idea of how to solve that?
Even when I dismount a disc, it does not go to sleep
IMG_20190929_180611.jpg
IMG_20190929_180611.jpg (61.04 KiB) Viewed 530 times

epoch1970
Posts: 3873
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: External hard drives that no longer standby under rasbian buster

Sat Oct 19, 2019 8:42 pm

Gilder wrote:
Sat Oct 19, 2019 7:16 pm
Even when I dismount a disc, it does not go to sleep
Did you check with the "mount" command that the device is not mounted still?
Your OS is running off the SD, or one of the drives?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Gilder
Posts: 5
Joined: Fri Oct 18, 2019 8:43 pm

Re: External hard drives that no longer standby under rasbian buster

Sat Oct 19, 2019 9:04 pm

you can look at the result of the command "mount" and "lsblk" . And yes , raspbian is installed on the SD card
mount.jpg
mount.jpg (101.42 KiB) Viewed 480 times
lsblk.jpg
lsblk.jpg (50.95 KiB) Viewed 480 times

andrum99
Posts: 927
Joined: Fri Jul 20, 2012 2:41 pm

Re: External hard drives that no longer standby under rasbian buster

Sat Oct 19, 2019 10:20 pm

Code: Select all

sudo apt update && sudo apt install hdparm
sudo hdparm -q -S 120 -y /dev/sda
You can also put calls to hdparm in /etc/rc.local to set the standby timeout at boot - works for me. See 'man hdparm' for details.

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: External hard drives that no longer standby under rasbian buster

Sat Oct 19, 2019 10:22 pm

If installed, hdparm automatically sets the APM level to 254 on all HDDs by default, and there is no spin-down from value 128.
You can edit the /etc/hdparm.conf, just uncomment the spindown_time line, and set value to 120, which is 10 minutes.

You can test it with the following command:

Code: Select all

sudo DEVNAME=/dev/sda /lib/udev/hdparm

Gilder
Posts: 5
Joined: Fri Oct 18, 2019 8:43 pm

Re: External hard drives that no longer standby under rasbian buster

Sun Oct 20, 2019 11:44 am

Kendek wrote:
Sat Oct 19, 2019 10:22 pm
If installed, hdparm automatically sets the APM level to 254 on all HDDs by default, and there is no spin-down from value 128.
You can edit the /etc/hdparm.conf, just uncomment the spindown_time line, and set value to 120, which is 10 minutes.

You can test it with the following command:

Code: Select all

sudo DEVNAME=/dev/sda /lib/udev/hdparm

I did that and now it works. But why 120 = 10 minutes? what is this 120?

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: External hard drives that no longer standby under rasbian buster

Sun Oct 20, 2019 11:51 am

Gilder wrote:
Sun Oct 20, 2019 11:44 am
I did that and now it works. But why 120 = 10 minutes? what is this 120?
You are welcome. Values from 1 to 240 specify multiples of 5 seconds, so 120 x 5 = 600 seconds, which is 10 minutes.

andrum99
Posts: 927
Joined: Fri Jul 20, 2012 2:41 pm

Re: External hard drives that no longer standby under rasbian buster

Sun Oct 20, 2019 3:48 pm

Kendek wrote:
Sun Oct 20, 2019 11:51 am
Gilder wrote:
Sun Oct 20, 2019 11:44 am
I did that and now it works. But why 120 = 10 minutes? what is this 120?
You are welcome. Values from 1 to 240 specify multiples of 5 seconds, so 120 x 5 = 600 seconds, which is 10 minutes.
Yup - It's explained in the man page for hdparm. I'm guessing it has to do with the way the timeout is encoded in the hard drives themselves - they've used a single byte to represent the standby timeout setting - 0 to 255 - and some clever maths to enable this to specify values up to several hours.

Return to “General discussion”