From owner-freebsd-questions@freebsd.org Sun Aug 30 12:58:54 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 E295D9C690F for ; Sun, 30 Aug 2015 12:58:54 +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 A5DAA962 for ; Sun, 30 Aug 2015 12:58:54 +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 t7UCwgAg052047 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Aug 2015 06:58:42 -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 t7UCwgUM052044; Sun, 30 Aug 2015 06:58:42 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 30 Aug 2015 06:58:42 -0600 (MDT) From: Warren Block To: Polytropon cc: freebsd-questions@freebsd.org Subject: Re: Replacing Drive with SSD In-Reply-To: <20150829220311.c7608be1.freebsd@edvax.de> Message-ID: References: <20150829220311.c7608be1.freebsd@edvax.de> 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]); Sun, 30 Aug 2015 06:58:42 -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: Sun, 30 Aug 2015 12:58:55 -0000 On Sat, 29 Aug 2015, Polytropon wrote: > On Fri, 28 Aug 2015 12:47:30 -0600 (MDT), Warren Block wrote: >> 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. > > To extend the idea (because sometimes I am the axe-and-byrnie type): > Does this also work with _no_ partitions at all? For example, when > the device is formatted "as a whole" (dedicated), like > > # bsdlabel -w ada0 > # bsdlabel -e ada0 > set type "4.2BSD" for 'a' partition > make 'a' same size as 'c' > save > # newfs -m 0 -i 16384 -b 16384 -f 2048 -U -t enable -n disable -L ssdroot /dev/ada0a > # bsdlabel -B ada0 > > where /dev/ada0a has been prepared with bsdlabel to span the entire > device (as in the example) - or in this case, to be a little bit > less (4G) than the whole disk capacity? Making a partition for free space is one way. Another way is to leave part of the drive unpartitioned. Either one just guarantees there is a good supply of unused blocks available to the drive. I'm fairly sure that UFS does not write to every block under its control even during a format. Until written as part of a file, those blocks are also known to be unused. So forcing extra unused space is probably unnecessary most of the time.