this post was submitted on 06 Oct 2024
33 points (92.3% liked)

Linux

48222 readers
1026 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Solution:
hd-idle is the way to go (if you read their README, they explain that most drives don't support idle timers)

I've been looking into spinning down the drives of my NAS, as I use it infrequently and that brings power drain down from ~30W to ~17W.

Problem is, hdparm -S doesn't seem to do anything for these particular drives: if I set it and wait for the appropriate amount of time (eg. 5 seconds if set to 1) the drives are still reported as "active/idle" and power drain doesn't go down.

Both hdparm -y and hdparm -Y work fine, but I don't seem to be able to find settings for them in tlp (probably because they are commands rather than settings?).

Besides the caveats about disks living longer if they are kept spinning, are there reasons why I shouldn't setup a cron job (well, a systemd timer) that runs hdparm -Y every 10 minutes? (for example, could hdparm -y cause errors if run while the drive is being backed up?)

PS: According to hdparm's manpage, -y puts the drive standby mode while -Y puts it into sleep mode. Considering that in my case power drain seems the same either way, should I prefer one or the other?

you are viewing a single comment's thread
view the rest of the comments
[–] bloodfart@lemmy.ml 1 points 1 month ago

Hey I see that you found hd-idle.

Last time I tried to use it it wasn’t compatible with smartmon.

I would take smartmon over spin down every day of the week.

I’m gonna go out on a limb and assume the reason you have this problem with power is that you’re running a zfs/md-raid 5 or whatever. It may be a good idea to get away from that configuration. When you write a file to a 3 disk pool with parity, all three drives spin up. The details are a whole nother can of worms but the way that operating systems, busses and hbas interact with disks make this even worse.

I got away from that situation with a mergerfs/snapraid setup where my disks are jbod and writing a file to the pool only spins up one disk (with some caveats) and parity calculation is done at night as a snapshot all at once.

I do not think this saves power, although my power use has been very low in this configuration. I do think this saves drives, because snapraid is decently judicious with spin up/spin down work, amassing all the changes first then calculating what to put where and doing that all at once.

If your primary concern is power use and hard disk life, consider a ssd pool. The density and power consumption are why datacenters switched to them and why 3.5 racks are so cheap now in comparison.