Products > Embedded Computing

Removing power from idle hard drives via IO pin and FET from the kernel?

<< < (3/4) > >>

Nominal Animal:

--- Quote from: cedric! on July 04, 2023, 05:02:05 am ---I use older drives, that use 10W while spinning, and about 1 watt while being idle.
--- End quote ---
These old drives have four states: active, idle, standby, and sleep.
You can use hdparm -y /dev/device to put the drive to standby, and hdparm -Y /dev/device to put it into sleep.  Have you checked the power consumption when in standby or asleep?  When asleep, the power use should be basically zero, since very little of the drive logic (and not motor) is powered.

The Linux kernel will automatically soft-reset the drive when needed, raising it from sleep (or standby, of course).

You can use hdparm and smartctl (from smartmontools package; use it!) to control the actual timeouts on each spinny-rust drive.

To add quirks to the Linux ASMedia AHCI SATA driver, drivers/ata/achi.c isn't really the problem; the problem is determining exactly when it is okay to turn off the power to the drive, because the darn things have internal caches and such.  I'm not convinced it is worth the hassle.

Berni:

--- Quote from: DiTBho on July 04, 2023, 07:19:53 pm ---my NAS has a different strategy:

* consists of 3 SBCs
* SBC#0 is a very low power SBC without any disks. It boots from flash and spends time monitoring the lan for incoming requests; if so, it wakes up the second SBC. Also periodically wakes up SBC#2
* SBC#1 bootstraps from flash and mounts 6 disks in RAID5 with minimal services { ssh, sshfs, samba, NFS }

* SBC#2 is connected to backup devices { disks, tapes }, and has a privileged 10GBps connection to SBC#1. It is usually off except on weekends when backups are scheduled
* SBC#0 monitors SBC#1 and SBC#2, after 45 minutes of inactivity, SBC#0 issues a selective shutdown command
* SBC#1 boots, mounts disks, and launches services in 106 seconds
* SBC#2 boots, mounts devices, and launches services in 41 seconds
--- End quote ---

That is a nice strategy.
So SBC#0 is not actually serving up anything, just spying on LAN traffic that shows someone trying to access SBC#1?


My own storage solution is a NAS in the form of a x86 PC running Unraid. Not the most power efficient solution but you can get down to 20W when doing nothing (has about 100TB of storage). But it is still not that much power, so i don't really care. The NAS server cost many many times more than the power required to run it. Heck my Unraid license cost more than this NAS will burn in power for a handful of years.

Tho a tiny SBC based NAS might be a good idea to introduce at some point as a place to backup the real one every so often automatically. (Right now i just have the most important data manually backed up on some USB HDDs)

DiTBho:

--- Quote from: Nominal Animal on July 04, 2023, 11:53:01 pm ---Have you checked the power consumption when in standby or asleep?  When asleep, the power use should be basically zero, since very little of the drive logic (and not motor) is powered.

--- End quote ---

Measuring my Seagate Barracuda sATA 500GB disks (~2010), they consome ~50mA x 5V, and ~0.1mA x 12V when asleep, I think recent ones consume less electricity  :-//

magic:

--- Quote from: SiliconWizard on July 04, 2023, 09:26:25 pm ---The OP may want to read this though: https://superuser.com/questions/925847/demystifying-sata-hotplug
Beware, this is a rabbit hole.

--- End quote ---
SATA hotpulg is nobrainer. I use it all the time on consumer hardware, never had a slightest issue.

As they say, you need to hot(un)plug the SATA connector, not MOLEX (if using an adapter). SATA power connectors and disks are designed to properly sequence supply rails and avoid large inrush currents.
(Dis)connecting power or data first makes no difference. Some connectors combine these two, also no problem.
Unmount everything before hot removing, obviously.

I'm pedantic so I also spin down the disk before disconnection. Spinners cope with sudden loss of power by using the motor as generator to obtain emergency power for proper parking of the heads, but it's easy enough to shut them down orderly in advance. Linux does it too when powering down the whole system.

I use this, which also immediately logically removes the disk from Linux. Not 100% sure but I think it may also error out if the disk is in use (such as mounted), giving you a warning, unlike simply pulling the cable right away.

--- Code: ---echo 1 >/sys/block/sdx/device/delete
--- End code ---

DiTBho:

--- Quote from: Berni on July 05, 2023, 05:09:11 am ---So SBC#0 is not actually serving up anything, just spying on LAN traffic that shows someone trying to access SBC#1?

--- End quote ---

precisely  :D

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod