You can safely unmount and spin-down an external hard disk from the terminal most easily by using the command-line functionality of udisks, which does not require the use of sudo if your system is set up correctly. (To list your device names, enter mount in the terminal first.)
When you have found your external drive, use the following commands. You must first unmount the partition (use sdb1 or whatever mount showed as the location):
udisks --unmount /dev/sdb1
Then to safely remove (i.e. spindown- you will hear it click and spin-down), use only sdb, for example:
udisks --detach /dev/sdb
NOTE: It is of crucial importance here that you use sdb or sdc without a partition number when using the detach option; i.e. sdb1 or sdc1 will not work. The partition must be unmounted first and then the disk itself spun down as the examples show.
The udisks commands work successfully for all my pata and sata external hard disks.
udisks? It is not on my system. I found the packageudisks2, but that did not makeudisksorudisks2available. – Martin Thoma May 14 '16 at 08:06udisks. – Martin Thoma Jun 18 '16 at 07:16udisks. It's by no means any standard and thus not too helpful. – Dominik George Aug 01 '16 at 19:10udisks: The udisksd2 daemon is the number one offender for not letting your harddisks spin down in the first place based on their idle timeout (hdparm -S)! Unless the timeout is very short. It also causes unnecessary spin-ups – as a silly example,udisksctl --helpwill spin up all your disks (including unmounted ones). But the worst is that this udisk stuff is hard to ban from your system, because it is depended on by various of GUI programs – my best workaround is tokillall -SIGSTOP udsiksd2in a cron job and unfreeze those GUI applications with SIGCONT as needed. – user2394284 Feb 08 '17 at 23:53