From owner-freebsd-questions@freebsd.org Thu Aug 20 02:44: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 27F7B3AA5A6 for ; Thu, 20 Aug 2020 02:44:07 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (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 4BX89d4VcXz4v38 for ; Thu, 20 Aug 2020 02:44:05 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.20.202]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPA (Nemesis) id 1MI59b-1juY3i2hEt-00FCNZ; Thu, 20 Aug 2020 04:43:53 +0200 Date: Thu, 20 Aug 2020 04:43:52 +0200 From: Polytropon To: freebsd@dreamchaser.org Cc: Manish Jain , Christoph Kukulies , Ruben via freebsd-questions Subject: Re: Correct way to disconnect/eject an USB hard disk ? Message-Id: <20200820044352.678a588e.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=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:JJ2w0b1HHAr5cD12eJcDr+BdStaq+29qPriR8CqTyjiDyrS4JNe gW4U9wZs1c4j9Bg5VHq9Fu/+FT5dpxOgpmB1xIpMFEiLAUo2/vNXFNbOX/Y9wUY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d4VcXz4v38 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.135) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.30 / 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.22)[-0.218]; RECEIVED_SPAMHAUS_PBL(0.00)[94.222.20.202:received]; SUBJECT_ENDS_QUESTION(1.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]; 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]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.11)[0.115]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.126.135:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.126.135:from]; FREEMAIL_CC(0.00)[hotmail.com,kukulies.org,freebsd.org]; 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:44:07 -0000 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 state. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...