From owner-freebsd-hackers@FreeBSD.ORG Fri May 18 20:55:01 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 88524106566C for ; Fri, 18 May 2012 20:55:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from springbank.echomania.com (andric.com [IPv6:2001:888:2003:1001:230:48ff:fe51:76b6]) by mx1.freebsd.org (Postfix) with ESMTP id 140D08FC08 for ; Fri, 18 May 2012 20:55:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at springbank.echomania.com Received: from [192.168.1.6] (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by springbank.echomania.com (Postfix) with ESMTPSA id 698BDA7071; Fri, 18 May 2012 22:54:29 +0200 (CEST) Message-ID: <4FB6B713.7080807@FreeBSD.org> Date: Fri, 18 May 2012 22:54:43 +0200 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120425 Thunderbird/13.0 MIME-Version: 1.0 To: User Wojtek References: In-Reply-To: X-Enigmail-Version: 1.5a1pre Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: proper newfs options for SSD disk X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 May 2012 20:55:01 -0000 On 2012-05-18 22:11, User Wojtek wrote: > what are proper settings > > a) 4kB fragments so everything is 4k aligned? SSD drives itself reports > as 512 byte blocks, but it is recomenned constantly on many places about > 4K alignment for SSD. That 4k alignment is most likely meant for so-called "advanced format" hard drives (the good old magnetic platter ones); these present 512 byte sectors to the ATA interface, but use 4096 byte sectors internally. With SSDs however, you cannot automatically tell what their erase block size is. Some of them use 128kB, others 256kB, and there are probably also devices with variable erase block sizes. You may be able to find the exact erase block size in the technical documentation of your specific SSD. But the manufacturers don't always tell. :) > b) small fragments (like 1KB) to reduce space usage, as there is no > seeking so it will not slow down but save space on relatively small SSD I don't think you would want to write lots of very small fragments to any SSD. :) > c) anything else? Be sure to use "-t enable" when creating the filesystem: -t enable | disable Turn on/off the TRIM enable flag. If enabled, and if the under- lying device supports the BIO_DELETE command, the file system will send a delete request to the underlying device for each freed block. The trim enable flag is typically set when the underlying device uses flash-memory as the device can use the delete command to pre-zero or at least avoid copying blocks that have been deleted.