Correct way to disconnect/eject an USB hard disk ?
freebsd at edvax.de
Thu Aug 20 02:51:07 UTC 2020
On Wed, 19 Aug 2020 22:06:04 +0530, Manish Jain wrote:
> On 2020-08-19 21:12, 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.
> No idea, Gary.
> But umount only returns when pending I/O has been flushed to the device.
Always keep in mind what this technically means: The input buffer
of the device has received the data from the host, and the controller
has reported back that the data has successfully and currectly
arrived in the input buffer. Nothing more, nothing less. As you
see, this has nothing to do with the data being written to the
actual storage medium - this happens internally, controlled by
the firmware of the USB stick.
> If the device's activity LED still keeps blinking, there are two
> explanations I can think of :
> 1) The LED sensor is either faulty or is simply signalling availability
> of power (in case there is no separate power LED).
The firmware defines when and how the LED will be blinking.
There is no real standardized concept: Some USB sticks show
constant light when powered on, and flashing light when reading
or writing, while others show short blinking when being
connected, and long blinking when reading or writing, with
the LED off during inactivity.
> 2) The device has some internal flash storage intermediate to its main
> storage area. While umount could return when data has been sent into the
> flash buffer, the device still has to internally reallocate the data to
> main storage (as might be the case with SSHD: solid state hybrid disk).
> In such case, it would be prudent to wait for the LED to stop blinking
> before unplugging the device. But if the LED keeps blinking forever, I
> would think there is some fault with the LED itself.
If the LED keeps blinking for no obvious (!) reason, it might
be a faulty USB stick, but there are many other possible
explanations, such as buggy firmware (blinks the LED for no
reason because it's stuck in a loop) or "internal remapping"
because the USB stick is actually busy at a "sub-FS level"
trying to compensate faulty memory blocks.
However, it might also indicate a compromized system, where
something is trying to access the USB stick outside of the
control of the user.
Some USB sticks don't even have a LED, so in such such cases,
the "wait a few seconds" suggestion is the best you can do,
and _hope_ for the best. :-)
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
More information about the freebsd-questions