From owner-freebsd-questions@freebsd.org Fri Aug 28 18:55:15 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA4DF9C5F8C for ; Fri, 28 Aug 2015 18:55:15 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 879B227C for ; Fri, 28 Aug 2015 18:55:15 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id t7SItDFq018835 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 28 Aug 2015 12:55:14 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id t7SItDUm018832; Fri, 28 Aug 2015 12:55:13 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 28 Aug 2015 12:55:13 -0600 (MDT) From: Warren Block To: "Brandon J. Wandersee" cc: Matt Smith , freebsd-questions@freebsd.org Subject: Re: Replacing Drive with SSD In-Reply-To: <864mjj1fh3.fsf@WorkBox.Home> Message-ID: References: <55E01DAE.1020709@infracaninophile.co.uk> <20150828084643.GB1274@xtaz.uk> <864mjj1fh3.fsf@WorkBox.Home> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Fri, 28 Aug 2015 12:55:14 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2015 18:55:15 -0000 On Fri, 28 Aug 2015, Brandon J. Wandersee wrote: > > Matt Smith writes: > >> I've heard a rumour that you should never use dd with SSD drives because >> of the wear levelling stuff. Apparently SSDs automatically make sure >> that data is sent to unused flash cells so that all the cells wear >> evenly, but if you use dd on them it makes them think that every single >> cell is in use which screws this up? > > I've read the same thing before, but I can't imagine it would really be > a problem if it's the first thing you do with a new disk (and the only > time you do it). The SSD keeps a map of which blocks have been written. So writing just once with dd is not a wear problem. The problem is that now the SSD has no way of knowing whether that block has real data on it or not. So it can't swap it for wear leveling. That's what trim does--when a file is deleted, the filesystem uses trim to notify the SSD that those blocks are no longer in use. On a bigger level, a "secure erase" resets all the blocks on a drive to unused, and can restore performance to an SSD. Of course, it erases all the data also... so restore from the backup that was made first. But not with dd. :)