From owner-freebsd-questions@freebsd.org Mon Sep 7 16:00:31 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 229A89CCB9C for ; Mon, 7 Sep 2015 16:00:31 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8C4A1EE1 for ; Mon, 7 Sep 2015 16:00:30 +0000 (UTC) (envelope-from brandon.wandersee@gmail.com) Received: by iofb144 with SMTP id b144so92287143iof.1 for ; Mon, 07 Sep 2015 09:00:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; bh=88FVeTYH336NLyPSlJmJKqTzFSEGECYGA90m24wc4jY=; b=h2eqUbYxG3aIfGGmXCiwk0IPSU0y+BZLqspqRxXUToDMH79gJx+ShFCeJdLKuoiuL/ ie4yLMMY7iTSfnoHsM6cMFDWmAClzcH+dMbZxOHNKZGpu/c4+XgyRC2OEr5pwwSnyKmB ePZtpcCccaIi0QROwysNHKAOQGeXX+Ch0HPT4EUgItqXUr3JfGSy2ROQahEGh8SV/cKD UfJRY5eEqT1QArq0vLdEbLRs3E6jinCCrC/adxMhdmWoZOyewpw4bfvmxxvR3bg1Cc+F r8loSZClfaYTyY0Q3OjmSqNPUzpw+l5JfTTWTroTawADwiSCoEzWJ/PHsX44b5Qx06Qe HdtQ== X-Received: by 10.107.26.138 with SMTP id a132mr29774204ioa.5.1441641193947; Mon, 07 Sep 2015 08:53:13 -0700 (PDT) Received: from WorkBox.Home.gmail.com (174-30-208-115.mpls.qwest.net. [174.30.208.115]) by smtp.gmail.com with ESMTPSA id os9sm367413igb.11.2015.09.07.08.53.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 08:53:13 -0700 (PDT) References: <55E01DAE.1020709@infracaninophile.co.uk> <20150828084643.GB1274@xtaz.uk> <864mjj1fh3.fsf@WorkBox.Home> <8637yro6nu.fsf@WorkBox.Home> From: Brandon J. Wandersee To: Warren Block Cc: freebsd-questions@freebsd.org Subject: Re: Replacing Drive with SSD In-reply-to: Date: Mon, 07 Sep 2015 10:53:11 -0500 Message-ID: <8637yqz0ns.fsf@WorkBox.Home> MIME-Version: 1.0 Content-Type: text/plain 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: Mon, 07 Sep 2015 16:00:31 -0000 Warren Block writes: > On Sun, 6 Sep 2015, Brandon J. Wandersee wrote: > >> >> Warren Block writes: >> >>> 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. >> >> Would this also apply to a *single file* written using dd? Your SSD >> guide recommends creating a swap file from /dev/zero using dd: >> >>> Because the data goes through the file system, TRIM will be used, and >>> the swap file can be resized without repartitioning the SSD. >> >> So is the problem with dd and SSDs only relevant when targeting a whole >> block device? > > Yes. Well, really it is about writing with methods that do not track > whether a block is in use. When that swap file is deleted, UFS tells > the SSD that all those blocks are no longer in use. dd(1) does not even > have the concept of blocks being used or not, it just copies data. Good to know, thanks. -- ================================================================= :: Brandon Wandersee :: :: brandon.wandersee@gmail.com :: ================================================================== 'A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.' - Douglas Adams ==================================================================