From owner-freebsd-questions@freebsd.org Fri Aug 28 18:47:32 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 4A49F9C5D36 for ; Fri, 28 Aug 2015 18:47:32 +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 0D9B81E08 for ; Fri, 28 Aug 2015 18:47:31 +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 t7SIlU6G017001 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 28 Aug 2015 12:47:30 -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 t7SIlUCD016998; Fri, 28 Aug 2015 12:47:30 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 28 Aug 2015 12:47:30 -0600 (MDT) From: Warren Block To: Doug Hardie cc: FreeBSD - Subject: Re: Replacing Drive with SSD In-Reply-To: Message-ID: References: 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:47:30 -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:47:32 -0000 On Thu, 27 Aug 2015, Doug Hardie wrote: > I am having to replace a drive with a SSD. Normally if I were > replacing it with another drive, I would hook up the new drive to the > computer and just use dd to copy everything (system would be > quiescent). Beyond copying unused blocks which can mess with wear leveling on SSDs (and wastes time on spinning drives) and blindly copying the partition tables (which goes wrong with GPT backup tables), consider that the copy is binary identical to the original. So GUID is not so "U" any more. Probably that will not cause a problem, but since dd has other problems when copying drives, best to use dump/restore for UFS or send/recv for ZFS. > Can I do the same with a SSD or does it need to be setup differently? > This is a boot drive (i.e., the only drive in the system). It *can* be done, but there are better ways. For SSDs specifically: Use GPT because it is easy to control where partitions start. Use gpart's -a flag to align to 4K blocks, or even 1M or 2M boundaries for an SSD. Enable trim with UFS. Use SU rather than SU+J with UFS. If you are a belt-and-suspenders type, create a smallish, maybe 4G, partition on the drive that will never be used and leave it empty. Don't write to it, ever. This is called over-provisioning. The drive sees that all those blocks are free and it can swap them around for wear leveling. This can be used in addition to trim.