5

Supposing I am more interested in power consumption than the lifespan of the HDD, does Raspberry Pi 3 power down automatically an external USB hard disk?

If it doesn't do it automatically by default, can I set it up to do so (I am thinking of getting a RPI3 with Ubuntu Mate 16.04)?

2

1 Answer 1

9

Yes. Here's what I use:

hdparm -B 127 /dev/sda
hdparm -S 242 /dev/sda

From the command line as the pi user you would have to add sudo there. The first line enables spin down. The second one sets it to happen after 1 hour of inactivity. This is documented in man hdparm. You may need to sudo apt install hdparm first.

Beware that's the device node (sda), not a partition (sda1).

It also requires that your drive be compatible with whatever generic protocol that is. I have never found one that isn't, but they are out there.

My drive is appropriately lifeless when checked. I use it mounted via network, and if it is spun down, when accessed it takes a second or two to spin up. Often this does not happen immediately because there can be some information about the filesystem cached, so, e.g., you may navigate down into a directory tree and at some arbitrary point there will be a bit of a freeze before you can keep going.

Other than that, leaving partitions mounted is not affected by spin down, nor vice versa (spin down is not affected by leaving partitions mounted).

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.