I use my Pi as a homeserver (headless via ssh, always on, restarted once a week). It's running raspbian, and I am running Ubuntu on my Desktop. Now, I want to add hard drives for backups and NAS to the Pi. At the moment I use an external usb hard drive, but later I may want to use a raid system (in case a drive fails). I also use autofs with --ghost to unmount the drive when not used for some time.
The idea/hope behind this was that the hard drive would go into some kind of standby/spindown mode when unmounted via autofs, but this is not the case. It seems to spin as fast as always, and it also gets as warm as when mounted.
So what I want is mass storage that goes to the deepest sleep/standby mode available, so it does not get too hot, saves energy and only awakes when needed (i.e. when mounted). Does someone know how I can achieve this? Thanks.
EDIT: I tried the following:
$ sudo hdparm -Y /dev/sda
/dev/sda:
issuing sleep command
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
and
$ sudo hdparm -y /dev/sda
/dev/sda:
issuing standby command
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
and
sudo sdparm --flexible --command=stop /dev/sda
this seems to be nearly the fix, the drive spins down, but gets fast again after a second or so.
EDIT2: This looks promising:
Someone told me I should use eject, and it worked. It's not installed by default, though. So I did the following:
sudo apt-get install eject
sudo eject /dev/sda
And the drive spinned down completely. Autofs was still able to wake it up. Since I use autofs to decide when the drive get's unmounted (and to automatically mount it again when needed), I have to execute this command when autofs unmounted the drive. I did not find a solution to do this, though. Do you have any suggestions?