On a Macbook Pro M1 with MacOS Monterey 12.5.1, I have an external 2.5" USB hard drive that I use regularly. When done using it, naturally I eject the volume by dragging it to Trash. This unmounts the volume but the disk remains physically spinning. Since this drive is powered by USB, when I then unplug the USB cable, it loses power while still spinning.
I understand that modern drives handle this without damage, and that myths about the utter necessity of "parking" a disk are based on the hardware of 40 years ago. However, I believe I have read that drives are rated for a much smaller number of these "emergency" spin-downs over their lifetime, compared to power-off with the drive already spun down, and power-off retract count is a specially tracked statistic in S.M.A.R.T. data (0xAE or 0xC0). So my understanding is that, for longevity, it is still preferable to spin down the drive before unplugging. How do I do that?
GUI preferred but command line would also be okay. Under Linux I would do
udisksctl power-off but that command does not exist under MacOS.
There are several questions on this site about spinning down drives when idle, and how to set the timeout, but that wouldn't really help me unless I was to wait for the timeout after unmounting.
To be clear, if possible I'd rather not change spin-down times or other behavior in general. I'm happy with the way the drive spins up and down while in use. I just want to be able to spin it down after unmounting, or immediately upon explicit request. Again, an exact equivalent of Linux
udisksctl power-off would be ideal - you issue the command, the drive spins down right away, and its settings are otherwise unaffected.
The linked "duplicate", if I understand it correctly, is about spinning down a drive while keeping it mounted (so that it would automatically spin up when accessing again). Here I want to spin down a drive that has already been unmounted, and that will not be mounted again before the drive is disconnected, so I don't think this is a dupe. And in fact I did find a simple solution that is specific to that scenario (only works when unmounting the drive), so if this question is reopened I can post it as an answer.