From owner-freebsd-questions@freebsd.org Wed Aug 19 12:56:38 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 820BF3BE02B for ; Wed, 19 Aug 2020 12:56:38 +0000 (UTC) (envelope-from bourne.identity@hotmail.com) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-oln040092064025.outbound.protection.outlook.com [40.92.64.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BWnps3LM3z3WF8 for ; Wed, 19 Aug 2020 12:56:37 +0000 (UTC) (envelope-from bourne.identity@hotmail.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PGf9Yjekox97SuUZ9STxJ6qNRJShJdLivuMaatsB9ygLgBZ0yq6Dlz8GYMaW/HkcyCKuzTz2niExk3I09N1kIzNJswGOEHSx1zIsmLlZMMguQN+50ylFb9WSMfKhm6ufz+qVtFG+sb/Za5WdTeoGFEQmC+8t6Ak0HJ7fEIqYBADyKv2RzBmCcg6Chz8AGMZaq4DKD1BMG9RFKWkjIrCE1sSGmBH7kL3TZJXQD/Ttafv/DP6ZMNtlHCiISPC/wCDUB7Xj7MxWJuicYeIBfFke1thsbvk/+85AVspvBKAXyHpHPsDkAYQgMltdpe+RhlwaJVoUh/aHayu01+ZZMMy2Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MapvZugxkDKC2Q8Jz25+MybQXtvrjbrpPDXUdDENPWg=; b=nOFMY2aoEhPPHtTHW5msHk101S6AVItJZTlIQRvG6KOXIa7AIFF96ir3lPmDWcjSxtL8NakMTTmucgd1qfbyFh32FjprpQF6KzT5LE2GS19KD+Sn5wXRjvJXMEy0YZzvUx3n9XH9goyN4uALgvzSW4nbigLHb0k2IuupFnobCpF1qXDbeGj+f3iZ+3rZf9E6HwvEH6U7HIhOtMonNcTzQDni9MkdgaBi6y/6jwJlPdnrOol/O7jaVKGp8CBXNPK4irDKrTBin0R5O7agBGPSIzFoPVKxp0rVfCwrJIXPL5Al5NACJrEfFB3PDELvRW938e7fKPG9BF3jz6u3e32Qww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MapvZugxkDKC2Q8Jz25+MybQXtvrjbrpPDXUdDENPWg=; b=aQ+y1VbN/Xc+b5Mz/RavU5nsVWZ1cJH+1bym0U+xlC7/I0FQShm14W0PX+w4WbbzlZPFYl3YjPBFJtsnNXREm5GKcW8ToPYtv3t7+ppxT8W27JjnLCjRuav0OEWm/29ZoU7EE67/uiMoUfebsIX9aafUzdwcOAs23XIpfyqJEz22Wadaz7ukSPRywPDBfooGWSxV/254iGHAr4wn2h7hZErn8h6IaSotk0v/erJLzqtp0qk76TmWNQDCQ3GnmzEwxLvVTY9Ecpo5uSwpmW4Y9Pzd+Vu+Jl9yno3pRtWhuiAHLmKImq0dQgy02xEQN2HOnJYtgJdfwW9pUWKrc5R1bw== Received: from DB5EUR01FT014.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e1a::46) by DB5EUR01HT103.eop-EUR01.prod.protection.outlook.com (2a01:111:e400:7e1a::483) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.24; Wed, 19 Aug 2020 12:42:27 +0000 Received: from DB8PR06MB6442.eurprd06.prod.outlook.com (2a01:111:e400:7e1a::47) by DB5EUR01FT014.mail.protection.outlook.com (2a01:111:e400:7e1a::242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.24 via Frontend Transport; Wed, 19 Aug 2020 12:42:27 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:FB1FB27189C1B1B605603A9A82A53AB856B7FAA814C975579A57FC61AA12992C; UpperCasedChecksum:8786333A447022009020C9D3C9888B4067DB15F8A66ACBD0570FB6BC4C5AC7F8; SizeAsReceived:8884; Count:49 Received: from DB8PR06MB6442.eurprd06.prod.outlook.com ([fe80::71dd:33c7:29cb:19ea]) by DB8PR06MB6442.eurprd06.prod.outlook.com ([fe80::71dd:33c7:29cb:19ea%7]) with mapi id 15.20.3283.028; Wed, 19 Aug 2020 12:42:27 +0000 Subject: Re: Correct way to disconnect/eject an USB hard disk ? To: Polytropon , Christoph Kukulies Cc: Ruben via freebsd-questions References: <20200819142952.3686baa8.freebsd@edvax.de> From: Manish Jain Message-ID: Date: Wed, 19 Aug 2020 18:12:34 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 In-Reply-To: <20200819142952.3686baa8.freebsd@edvax.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BM1PR0101CA0060.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::22) To DB8PR06MB6442.eurprd06.prod.outlook.com (2603:10a6:10:126::7) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.2] (103.195.202.172) by BM1PR0101CA0060.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:19::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3305.24 via Frontend Transport; Wed, 19 Aug 2020 12:42:25 +0000 X-Microsoft-Original-Message-ID: X-TMN: [7VMij0s8QV1GiQ0wAwCYr9UtHvSgqIMKiCRpFLd3m6U=] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: f88fa593-ac46-47a3-42de-08d8443d5411 X-MS-TrafficTypeDiagnostic: DB5EUR01HT103: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KRPHeMExEj30UKYGcg5S1q+62unD1mj3yCHKxCf7XUc+CLnfkd1oZfSJsWvwlU5afPHtMsG1Z+gAwtUinTg/X9dkK9EBdDK/niPHtj2RQ4dGKiq/Qkid6Bqnx3vNLWhZcU5psQqk0bWsvxbTlUWG0YPSUKsH1eFLJAP2aa3YgRBUicHRYWpIJv55LNhu1uhdl6aomPXFXDt2R/7CES9mDw== X-MS-Exchange-AntiSpam-MessageData: H8pvz0iUrATxckOJOZikM9lhlf3e6/I/WKmZ9a1LcIKG0cXecCWP5CS0Z5jMUO8jf3TQY+WQ/Ion/QK9h8X6XGiBuO/nvMc3K0ZkshtIUTuNNHwlcNibTCB3urEBbUOJFKxzDOJwwIHM8oLAkc41pg== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: f88fa593-ac46-47a3-42de-08d8443d5411 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2020 12:42:26.9724 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB5EUR01FT014.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR01HT103 X-Rspamd-Queue-Id: 4BWnps3LM3z3WF8 X-Spamd-Bar: ++++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hotmail.com header.s=selector1 header.b=aQ+y1VbN; dmarc=pass (policy=none) header.from=hotmail.com; spf=pass (mx1.freebsd.org: domain of bourne.identity@hotmail.com designates 40.92.64.25 as permitted sender) smtp.mailfrom=bourne.identity@hotmail.com X-Spamd-Result: default: False [8.50 / 15.00]; FREEMAIL_FROM(0.00)[hotmail.com]; R_SPF_ALLOW(0.00)[+ip4:40.92.0.0/15]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[hotmail.com:+]; DMARC_POLICY_ALLOW(0.00)[hotmail.com,none]; NEURAL_HAM_SHORT(-0.00)[-0.000]; RECEIVED_SPAMHAUS_PBL(0.00)[103.195.202.172:received]; SUBJECT_ENDS_QUESTION(1.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[hotmail.com]; ASN(0.00)[asn:8075, ipnet:40.80.0.0/12, country:US]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[]; ARC_ALLOW(0.00)[microsoft.com:s=arcselector9901:i=1]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_XBL(5.00)[103.195.202.172:received]; RCVD_COUNT_FIVE(0.00)[5]; R_DKIM_ALLOW(0.00)[hotmail.com:s=selector1]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[hotmail.com:dkim]; BAD_REP_POLICIES(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[40.92.64.25:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.92.64.25:from]; GREYLIST(0.00)[pass,body]; MAILMAN_DEST(0.00)[freebsd-questions] X-Spam: Yes 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: Wed, 19 Aug 2020 12:56:38 -0000 On 2020-08-19 17:59, Polytropon wrote: >> After unmounting, are there any other measures to cleanly disconnect >> the device? > Usually not. If umount has been executed, and you wait a few > seconds in order to let the command be finished successfully > by the USB drive's firmware (last things to be written are > _actually_ written), disconnect is possible at any time. The > important thing to consider is that the filesystem should > always be in a consistent state - that's what umount will > accomplish. Due to the fact that "things need some time", > waiting a few seconds is never wrong. After that, disconnecting > power is no problem. A note: it is perfectly safe to disconnect device any time after umount has returned. The one problem is umount may take anything between a second and a few hours (!) to return. This depends on whether the filesystem was mounted as sync or async (the default). When fs is mounted with sync option on, I/O is very slow - ~10x slower than with async. With async option on at the time of mount, I/O is much faster, the algorithmic complexity of the code dealing with the I/O is much higher, and a whole lot of data may remain unflushed even after an I/O command (cp for instance) has returned. It is at the time of umount all this data gets flushed - although you can manually force the flush yourself with `sync`, in which case `umount` will return quickly. Hope this helps, Manish Jain