WD Advanced Format: do I need to do something special?

Marc Fonvieille blackend at freebsd.org
Thu Aug 18 10:09:13 UTC 2011


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: <WDC WD10EARS-00Y5B1 80.00A80> 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:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>


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


More information about the freebsd-stable mailing list