Emoncms on pi, power down external drive

The second post in that thread looks like it has the info you need.