bluenote
Posts: 99
Joined: Thu Feb 05, 2015 8:25 am

Rpi4 w/ several USB harddrives idle spindown

Sat Dec 07, 2019 7:55 pm

There's a lot of conflicting information on how to deal with this. I see people saying certain methods are obsolete or not ideal, but from my perspective the info is a mishmash.

I have a few Seagate, Samsung and WD USB external drives that I plan to run off my RPI4 through a USB 3 hub, and currently the ones I have connected do not spin down on idle. What's the recommended way to do this with Raspbian Buster?

thanks

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

Re: Rpi4 w/ several USB harddrives idle spindown

Sat Dec 07, 2019 9:45 pm

Solution 1: Use the automounter and let the firmware in the drives do their job when the drives are unmounted and idle for a while.
Solution 2: fliddling with hdparm, sdparm, ext4 settings, etc.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

bluenote
Posts: 99
Joined: Thu Feb 05, 2015 8:25 am

Re: Rpi4 w/ several USB harddrives idle spindown

Sat Dec 07, 2019 9:59 pm

epoch1970 wrote:
Sat Dec 07, 2019 9:45 pm
Solution 1: Use the automounter and let the firmware in the drives do their job when the drives are unmounted and idle for a while.
Solution 2: fliddling with hdparm, sdparm, ext4 settings, etc.
Are you suggesting manually unmounting when I am done? Because this drive will be accessed over the network sometimes. If you're suggesting something more automatic please give a few more details. Thx

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

Re: Rpi4 w/ several USB harddrives idle spindown

Sat Dec 07, 2019 10:38 pm

An automounter looks after paths you've configured. It creates an empty path, traps any attempt to access the path and mounts the target resource (device, server share...) on the fly if needed. Once nothing uses the path for a while, it dismounts the resource. The original purpose was mounting NFS shares from central servers.

The systemd automounter is relatively simple to use: https://www.freedesktop.org/software/sy ... mount.html
(autofs5 is the traditional linux automounter. While considerably capable, making it work is sort of a flashback to the 80's. Probably not useful to most.)

There are a lot of threads about "automounting" in the forum, beware that half of them relate in fact to some USB/udev daemon that mounts USB devices when you plug them in. Same idea, same name (...) but not the same usage.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

bluenote
Posts: 99
Joined: Thu Feb 05, 2015 8:25 am

Re: Rpi4 w/ several USB harddrives idle spindown

Sat Dec 07, 2019 11:26 pm

epoch1970 wrote:
Sat Dec 07, 2019 10:38 pm

There are a lot of threads about "automounting" in the forum, beware that half of them relate in fact to some USB/udev daemon that mounts USB devices when you plug them in. Same idea, same name (...) but not the same usage.
Hence my confusion. I thought this was what you are talking about. Thanks for clarifying

bluenote
Posts: 99
Joined: Thu Feb 05, 2015 8:25 am

Re: Rpi4 w/ several USB harddrives idle spindown

Mon Dec 09, 2019 5:25 pm

So far hdparm worked with 2, and hd-idle seems to be working with 3. :/

Return to “Beginners”