Linux – HDD Power-Up in Standby: prevent from spinning up

bootgrubhard drivehdparmlinux

On my Linux Mint 17.1 system I am using a Western Digital WD20EZRX HDD for backup.
To minimize power consumption and to extend drive endurance, I want the HDD to normally
be in spun-down standby state, and to only spin up when explicitly needed.

This can be achieved in two ways:
The trivial approach would be setting the HDD into standby mode manually using hdparm -y /dev/sdb.
However, the disadvantage would be the drive spinning up during startup until being set to sleep again by a script.
Therefore I would like to let the drive Power-Up in Standby,
PUIS, to prevent it from spinnung up in the first time.

Some WD drives support PUIS, although it is called PM2, Power Management 2 Mode by Western Digital.
This feature is being enabled using Jumpers, as described in
this WD Knowledge Base article.
The result of this configuration can be verified using hdparm:

# hdparm -I /dev/sdb | grep "Power-Up In Standby"
   *    Power-Up In Standby feature set

However, the drive still spins up during boot, even before the Grub startup-screen is being displayed.
Could this be a misconfigured Bootloader, which is looking for operating systems on all connected HDDs?

Best Answer

I searched for the exact thing a few years ago, for Linux Mint and an old HD that was only used for occasional data storage too.

The solutions I found (don't have the links handy anymore) were the same that it looks like you found: a few hard drives might have a jumper setting that should cause the drive to stay sleeping / not spin up at boot time. But it did not work, my results were the exact same as yours, it still spins up at boot. I didn't find any fixes for that, for all I know it was the BIOS/GRUB/linux, separately or working together, or just the HD itself that wasn't listening.

I did some "hot plug"/"hot swap" testing, connecting the power to a (SATA) hard drive while the computer was up & running. It generated some log entries (dmesg & /var/log/syslog) and worked successfully. Then when done with the drive (sync, unmount, sleep/hdparm -y) unplugging the power again. Worked! But it apparently needs a compatible motherboard & OS, so YMMV.

However, pulling the power plug to use the drive isn't very convenient or easy, so I wired up a double-pole single-throw switch - DPST, Wikipedia has a diagram - has 4 terminals, for the 2 separate power wires (12V & 5V?), to keep them separate and turn them both on/off at the same time. Connecting it to the HD's power, I can turn on & off the drive whenever needed.

Update:

Hot swapping used to work on Linux Mint 14/15/16, but for some reason it quit working on 17 & up, I'm guessing some kernel change stopped it. Now hot swapping a hard drive on only appears to work, but the drive reads as corrupted, only a power-on reboot gets it working successfully. Maybe there's an easy way to get it working again, or some recompiled kernel is required with some special switches...?

Update 2

Hot swapping is apparently working again for Ubuntu 16.04 (Mint 18 should work too).

Related Question