From nobody Fri Jan 14 15:32:10 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A29721948C24 for ; Fri, 14 Jan 2022 15:35:14 +0000 (UTC) (envelope-from naddy@mips.inka.de) Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jb5356Ndbz4gjX for ; Fri, 14 Jan 2022 15:35:13 +0000 (UTC) (envelope-from naddy@mips.inka.de) Received: from mips.inka.de (naddy@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1n8ObY-00GCLD-Tf; Fri, 14 Jan 2022 16:35:04 +0100 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.16.1/8.16.1) with ESMTP id 20EFWAYi053058 for ; Fri, 14 Jan 2022 16:32:10 +0100 (CET) (envelope-from naddy@lorvorc.mips.inka.de) Received: (from naddy@localhost) by lorvorc.mips.inka.de (8.16.1/8.16.1/Submit) id 20EFWAqT053057 for freebsd-questions@freebsd.org; Fri, 14 Jan 2022 16:32:10 +0100 (CET) (envelope-from naddy) Date: Fri, 14 Jan 2022 16:32:10 +0100 From: Christian Weisgerber To: freebsd-questions@freebsd.org Subject: Re: zero filling a storage device (was: dd and mbr) Message-ID: References: <77680665-7ddb-23c5-e866-05d112339b60@holgerdanske.com> <20220114023002.GP61872@eureka.lemis.com> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Jb5356Ndbz4gjX X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of naddy@mips.inka.de has no SPF policy when checking 2a04:c9c7:0:1073:217:a4ff:fe3b:e77c) smtp.mailfrom=naddy@mips.inka.de X-Spamd-Result: default: False [-1.69 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[naddy]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.59)[-0.593]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; MID_RHS_MATCH_FROMTLD(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_NA(0.00)[inka.de]; MLMMJ_DEST(0.00)[freebsd-questions]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:202113, ipnet:2a04:c9c0::/29, country:DE]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N "Kevin P. Neal": > Are we certain that an SSD won't at least track that there is nothing > written to a logical block and therefore it must be all zeros? I'm not > 100% that an SSD will always keep a logical block assigned to a physical > block. And I'm not 100% certain that an SSD won't notice that all zeros > are being written to a block and just optimize out the write. It's tempting to speculate that an SSD could treat an all-zeros block write effectively like a TRIM. I'll note that there are SSDs that compress the data written to them. (Compression in storage devices isn't new. Terry Welch's 1984 paper, where he presented the LZW compression algorithm, already talks about this.) -- Christian "naddy" Weisgerber naddy@mips.inka.de