From owner-freebsd-fs@FreeBSD.ORG Wed Jun 13 14:24:23 2012 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 933C71065679 for ; Wed, 13 Jun 2012 14:24:23 +0000 (UTC) (envelope-from prvs=151131130d=killing@multiplay.co.uk) Received: from mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) by mx1.freebsd.org (Postfix) with ESMTP id 2153E8FC19 for ; Wed, 13 Jun 2012 14:24:22 +0000 (UTC) X-Spam-Processed: mail1.multiplay.co.uk, Wed, 13 Jun 2012 15:23:53 +0100 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail1.multiplay.co.uk X-Spam-Level: X-Spam-Status: No, score=-5.0 required=6.0 tests=USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.2.5 Received: from r2d2 ([188.220.16.49]) by mail1.multiplay.co.uk (mail1.multiplay.co.uk [85.236.96.23]) (MDaemon PRO v10.0.4) with ESMTP id md50020247582.msg for ; Wed, 13 Jun 2012 15:23:52 +0100 X-MDRemoteIP: 188.220.16.49 X-Return-Path: prvs=151131130d=killing@multiplay.co.uk X-Envelope-From: killing@multiplay.co.uk X-MDaemon-Deliver-To: freebsd-fs@freebsd.org Message-ID: From: "Steven Hartland" To: "Olivier Smedts" , "Irjohn Junus" References: Date: Wed, 13 Jun 2012 15:24:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Cc: freebsd-fs@freebsd.org Subject: Re: gpart add -a 4096 vs 4k X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2012 14:24:23 -0000 ----- Original Message ----- 2012/6/13 Irjohn Junus : > Hello, > > Relatively new to FreeBSD and learning, I'm trying to partition my HDD and > align it to 4k sector. > > I do apologize if this has been answered before, I have Googled and read > gpart(8) man page to no joy. Can anyone please advice why gpart add '-a > 4096' doesn't yield the same result with '-a 4k'? Many thanks and captures > are below. Question: Do you actually want to partition? Or are you just trying to get it 4k aligned? Its my understanding, someone correct me if I'm wrong, that if you just want to create a zfs volume on a disk you can just use the raw disk instead of a partition slice and alignment just works. Its only if you want multiple slices and hence need to partition that you need to worry about alignment. Also worth noting that if your 4k disk is actually reporting as 512b sectors e.g. cat /var/run/dmesg.boot |grep sectors da0: 57241MB (117231408 512 byte sectors: 16H 63S/T 16383C) Then you can use gnop hack to fix this:- gnop create -S 4096 da0 zpool create mytank da0.nop zpool export mytank gnop destroy da0.nop zpool import mytank This will ensure the value of the zpool ashift is 12 for a 4k disk. You can check this with:- zdb | grep ashift In my testing this made 100MB/s performance increase for sequential writes of none random data on a Corsair Force 2 60GB ssd. Regards Steve ================================================ This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. In the event of misdirection, illegible or incomplete transmission please telephone +44 845 868 1337 or return the E.mail to postmaster@multiplay.co.uk.