Correct way to disconnect/eject an USB hard disk ?
freebsd at edvax.de
Thu Aug 20 02:44:07 UTC 2020
On Wed, 19 Aug 2020 09:42:59 -0600, Gary Aitken wrote:
> Can you explain why I have seen umount commands return, and then the
> USB device "activity" light keeps blinking? I have on occasion waited
> for a while and it keeps blinking, and eventually I just unplugged it.
The "OS-side interface" to external USB-connected storage
does not exactly know what happens inside the controller.
The LED activity is defined by the firmware, which is not
disclosed by the manufacturer. While the OS, upon "umount",
basically says: "Here's the last chunk of data, sync it,
I'll detach /mnt from my VFS tree when you said you're
done." The USB controller accepts and confirms the last
chunk of data, reports back "Got it, everything is fine."
Now the umount command does what it says on the can, it
unmounts the medium, and returns control to the user.
Now _internally_ the USB stick is still busy _actually_
writing the last chunk of data to its storage, and the
firmware says: "Whenever you access the internal storage,
for whatever reason, make the LED flash." That's probably
what you're observing.
The idea of "just give it a few seconds after you physically
remove the USB stick" relies on the assumption that such
kind of activity takes place outside the control of the OS,
and the OS has no real way of discovering what's really
happening at that point. A few seconds are commonly enough
to make sure the processes internal to the controller and
its firmware have successfully finished, and the filesystem
(and data in general) on the USB stick is in the expected
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions