From owner-freebsd-questions@freebsd.org Thu Aug 20 02:51:07 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B3583AB18B for ; Thu, 20 Aug 2020 02:51:07 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BX8Kk2drtz4vth for ; Thu, 20 Aug 2020 02:51:05 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.20.202]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPA (Nemesis) id 1MpDRv-1kRPpB0179-00qfFg; Thu, 20 Aug 2020 04:50:54 +0200 Date: Thu, 20 Aug 2020 04:50:52 +0200 From: Polytropon To: Manish Jain Cc: freebsd@dreamchaser.org, Christoph Kukulies , Ruben via freebsd-questions Subject: Re: Correct way to disconnect/eject an USB hard disk ? Message-Id: <20200820045052.541363b7.freebsd@edvax.de> In-Reply-To: References: <20200819142952.3686baa8.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:hOrYDMCcDBNrkvo6X0nCAU58l6Ay6dledQjDhRNWGJ56QO8BlOd XGwg+v61BrKcpuRE01MutCtMBXgBRh/cMoXE32R+E4KPF6GSFql9DLGMsVwzrm0smlYrolu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Q== X-Rspamd-Queue-Id: 4BX8Kk2drtz4vth X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.131) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.51 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_SHORT(-0.33)[-0.330]; FREEMAIL_TO(0.00)[hotmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[94.222.20.202:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.44)[0.436]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.126.131:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.126.131:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-questions] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Aug 2020 02:51:07 -0000 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, ...