From owner-freebsd-stable@FreeBSD.ORG Thu Aug 18 10:09:13 2011 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BB1F106564A for ; Thu, 18 Aug 2011 10:09:13 +0000 (UTC) (envelope-from marc@blackend.org) Received: from smtp6-g21.free.fr (unknown [IPv6:2a01:e0c:1:1599::15]) by mx1.freebsd.org (Postfix) with ESMTP id C86738FC17 for ; Thu, 18 Aug 2011 10:09:11 +0000 (UTC) Received: from emphyrio.blackend.org (unknown [88.179.1.53]) by smtp6-g21.free.fr (Postfix) with ESMTP id 228F6822A5; Thu, 18 Aug 2011 12:09:03 +0200 (CEST) Received: from emphyrio.blackend.org (localhost [127.0.0.1]) by emphyrio.blackend.org (8.14.5/8.14.4) with ESMTP id p7IAAZkF002328; Thu, 18 Aug 2011 12:10:35 +0200 (CEST) (envelope-from marc@emphyrio.blackend.org) Received: (from marc@localhost) by emphyrio.blackend.org (8.14.5/8.14.4/Submit) id p7IAAYAg002327; Thu, 18 Aug 2011 12:10:34 +0200 (CEST) (envelope-from marc) Date: Thu, 18 Aug 2011 12:10:34 +0200 From: Marc Fonvieille To: Yuri Message-ID: <20110818101034.GA1958@emphyrio.blackend.org> References: <4E4CD19E.5070108@rawbw.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E4CD19E.5070108@rawbw.com> X-Useless-Header: blackend.org X-Operating-System: FreeBSD 8.2-STABLE User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-stable@freebsd.org Subject: Re: WD Advanced Format: do I need to do something special? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Aug 2011 10:09:13 -0000 On Thu, Aug 18, 2011 at 01:47:26AM -0700, Yuri wrote: > WD has sectors of the size 4kB in their latest hard drives, which is > different from the traditional 512B. > http://www.wdc.com/advformat > http://wdc.custhelp.com/app/answers/detail/a_id/5655 > > These articles assert that something special should be done in OS to > enable high performance of such drives. For ex. WD recommends to install > some latest drivers of particular version. > But what about FreeBSD? Should it be configured in some special way too > for these drive to perform well? > Is it aware of 4kB sector size? > I own that (I'm running 8-STABLE): ada0 at ahcich2 bus 0 scbus2 target 0 lun 0 ada0: ATA-8 SATA 2.x device ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C) which has 4kB sectors but says "512 byte sectors" :) I use the whole disk for the FreeBSD slice, I aligned all partitions on a multiple of 8 sectors (512*8=4096). By default fdisk(8) uses a 63 sectors default offset: ******* Working on device /dev/ada0 ******* parameters extracted from in-core disklabel are: cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl) Figures below won't work with BIOS for partitions not in cyl 1 parameters to be used for BIOS calculations are: cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl) Media sector size is 512 Warning: BIOS sector numbering starts with sector 1 Information from DOS bootblock is: The data for partition 1 is: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) start 63, size 1953525105 (953869 Meg), flag 80 (active) beg: cyl 0/ head 1/ sector 1; end: cyl 1023/ head 15/ sector 63 The data for partition 2 is: The data for partition 3 is: The data for partition 4 is: Look at "start 63" statement. Instead of fixing fdisk(8) behavior, I just correctly edited my bsdlabel(8) table: # /dev/ada0s1: 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 4194304 17 4.2BSD 0 0 0 b: 8388608 4194321 swap c: 1953525105 0 unused 0 0 # "raw" part, don't edit d: 16777216 12582929 4.2BSD 0 0 0 e: 1924163584 29360145 4.2BSD 0 0 0 The important part is the offset 17 to correct the fdisk(8) offset (16+1 to align the previous 63). The remaining offsets are calculted from the size I gave for the partitions (in MB, which can be divided by 8). Then I used newfs(8) with the option "-f 4096". There's another painful issue with this disk: the automatic head-parking after few seconds. I disabled it (with wdidle3) cause after 2 months of use, I was at more than 35000 head-parkings... -- Marc