Date: Thu, 20 Aug 2020 04:50:52 +0200 From: Polytropon <freebsd@edvax.de> To: Manish Jain <bourne.identity@hotmail.com> Cc: freebsd@dreamchaser.org, Christoph Kukulies <kuku@kukulies.org>, Ruben via freebsd-questions <freebsd-questions@freebsd.org> Subject: Re: Correct way to disconnect/eject an USB hard disk ? Message-ID: <20200820045052.541363b7.freebsd@edvax.de> In-Reply-To: <DB8PR06MB64420C592F160459B28CFD02F65D0@DB8PR06MB6442.eurprd06.prod.outlook.com> References: <C6B11926-65BE-4A05-B421-9F3E9C9AACF6@kukulies.org> <20200819142952.3686baa8.freebsd@edvax.de> <DB8PR06MB64427319E175193D1B828135F65D0@DB8PR06MB6442.eurprd06.prod.outlook.com> <b9b46ecb-b1ef-8f67-7b41-ae3cf0d3864b@dreamchaser.org> <DB8PR06MB64420C592F160459B28CFD02F65D0@DB8PR06MB6442.eurprd06.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 19 Aug 2020 22:06:04 +0530, Manish Jain wrote: >=20 >=20 > 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?=A0 I have on occasion waited > > for a while and it keeps blinking, and eventually I just unplugged it. >=20 > No idea, Gary. >=20 > But umount only returns when pending I/O has been flushed to the device.= =20 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=20 > explanations I can think of : >=20 > 1) The LED sensor is either faulty or is simply signalling availability=20 > 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=20 > storage area. While umount could return when data has been sent into the= =20 > flash buffer, the device still has to internally reallocate the data to=20 > main storage (as might be the case with SSHD: solid state hybrid disk).=20 > In such case, it would be prudent to wait for the LED to stop blinking=20 > before unplugging the device. But if the LED keeps blinking forever, I=20 > 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. :-) --=20 Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200820045052.541363b7.freebsd>