I need to start/stop an external hard drive (USB) from a shell or python script. Actually the external hard drive automatically stops when ejected. So, is it possible to programmatically eject / start an external hard drive? Something like USBDeview does for Windows :-)
Update:
My intended use case: I want to run a nightly backup to the external drive. As the drive is quite loud and to save on energy, I only want it to be active during the backup. I likely won't use Time Machine, but my own backup script.
mount
andumount
. – benwiggy Mar 2 '20 at 9:32