From nobody Fri Jan 14 17:14:18 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 A8AAF1944D66 for ; Fri, 14 Jan 2022 17:15:00 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from mailout.qeng-ho.org (mailout.qeng-ho.org [217.155.128.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jb7GC37HPz4Rn6 for ; Fri, 14 Jan 2022 17:14:59 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from [172.23.1.2] (arthur.home.qeng-ho.org [172.23.1.2]) by mailout.qeng-ho.org (Postfix) with ESMTP id BBCB03D65D; Fri, 14 Jan 2022 17:14:18 +0000 (GMT) Message-ID: <523b6b6d-b17c-e632-a36a-a8c26ad61798@qeng-ho.org> Date: Fri, 14 Jan 2022 17:14:18 +0000 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 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: zero filling a storage device (was: dd and mbr) Content-Language: en-GB To: Christian Weisgerber , freebsd-questions@freebsd.org References: <77680665-7ddb-23c5-e866-05d112339b60@holgerdanske.com> <20220114023002.GP61872@eureka.lemis.com> From: Arthur Chance In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Jb7GC37HPz4Rn6 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.244 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Spamd-Result: default: False [-3.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.155.128.240/29]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[qeng-ho.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-questions]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N On 14/01/2022 15:32, Christian Weisgerber wrote: > "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.) > May I suggest "man trim"? (From 12.1 onwards.) -- Nothing teaches one not to try to stamp out burning thermite quite like real-life experience. — James Davis Nicoll