How to safely eject USB drive before unplugging it?

ccman32

Dabbler
Joined
Aug 16, 2022
Messages
17
I know that there are already a few threads about this, but I couldn't find a clear answer in any of them.

I noticed that after exporting a pool which is located on a USB drive (WD Elements Portable), the drive just keeps spinning and the status LED stays on. Sometimes when I wait for a while, the drive would eventually spin down and turn off completely, but I couldn't figure out when this happens and why it takes so long.

In another thread I found the suggestion to run camcontrol eject /dev/da0, but even after running it, the drive is still spinning and doesn't power off.

I also tried usbconfig -d ugen0.2 power_off and while that does seem to work most of the time, it sometimes throws this error:
usbconfig: could not set power OFF: Device not configured

Once this error occurs, I noticed that when unplugging the drive and plugging it back in, it would randomly fallback to USB 2.0 speeds for whatever reason and not get detected as a USB 3.0 device anymore until I reboot the entire system.

Is there any reliable way to completely eject and power off the drive before unplugging it, just like I can do in Windows or other OSes?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Once you export the pool, it's safe to unplug the disk. I'm not aware of a reliable way to power it off, though.
 
Top