What unmount/eject in the UI does could be much better for external HDDs. POWER them OFF!!!
Affected Version
- Version: all versions everywhere. Sadly, I don't believe I've seen a Linux UI get this right.
- Distribution: Ubuntu 23.10 has the problem - i'm sure because i'm using it.
- Also affects development version: I haven't checked but I have little doubt it would because this is behavioral and I don't see debug binaries and symbols doing anything different.
Use Cases
Hit the eject/dismount button to eject an HDD. Then unplug the device. Often the motor will cry in protest. That's the motor suffering injury.
Available Workarounds
dev=mount | grep \/media | sed 's/\(.*\)[ ]on.*/\1/'
sudo udisksctl unmount -b $dev && sudo udisksctl power-off -b $dev
^ note this is indiscriminate as to WHICH drive is to be disconnected.
Difficulties
external HDDs must be powered down - not just unmounted - to be removed safely. Otherwise the disk is still spinning and pulling the USB cord out abruptly cuts the power. This results in a noise that makes me suspect the hardware is protesting (which is speculative - I know) but I started having external HDDs become flaky too early with their lives cut short with the motor refusing to begin spinning once plugged into the machine. It would make sense that overcoming the inertia of a completely non-moving disk would stress the motor more than maintaining the motion and hence this would be the earliest point a motor would give out.
I would understand how this might be dismissed as speculative or superstitious but I began using the above udisksctl command to eject my HDDs and ran into no more motor problems. I think it could be argued it is likely no coincidence.
By-the-way, HDDs are much more common as external hard drives than SDDs because capacity and price are MUCH BETTER than solid state and this seems it'll be the case for at least a while and we could assume into perpetuity. And they're perfectly suitable for cold storage because although the access latency is worse than solid state, that matters less when they're not used as the system drive and the bandwidth is perfectly great for large transfers)
Suggested Enhancements
Have the eject button not just unmount the drive but also power it off if it's an HDD.
I might note, in case it's relevant to someone who thinks the evil Goliath OS which often, sadly, ships on PCs (you know which one i'm talking about - I don't want to sully my keyboard by actually typing it), that THEY do cut the power when a user chooses to eject their external drive. So perhaps they were onto something in their implementation. I would suggest one might investigate further if there is doubt as to the utility of doing this since my guesswork might leave a bad taste in the reader's mouth. But also consider the damage if I'm right and this were ignored. There goes data and hardware on Linux machines while that other OS prevents such damage? How embarrassing.