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? Yuri
Jeremy Chadwick
2011-Aug-18 09:17 UTC
WD Advanced Format: do I need to do something special?
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?The below advice still applies. Do not skim the page, read it. http://ivoras.net/blog/tree/2011-01-01.freebsd-on-4k-sector-drives.html You will therefore have to go through some manual rigmarole (preferably with gpart(8)) to ensure performance. If you plan on using the disks in ZFS, you get to go through some extra rigmarole. Also be aware that mixed LBA sizes on things like RAID (and possibly ZFS?) may result in abysmal performance. I just got done assisting a user on a forum who had horrible performance on his 2-disk RAID-1 array driven by an Intel ICH9R using Intel's native RST driver under 64-bit Windows. How/why? He bought two drives, both WD10EADS (not a typo). However, one drive was WD10EADS-65M2BX (firmware 01.00A01, 512 byte physical, 512 byte logical) while the other was WD10EADS-11M2B1 (firmware 80.00A80, 4096 byte physical, 512 byte logical). He replaced the WD10EADS-65M2BX drive with another 4KB physical drive and his performance problem disappeared. I only point this out because this could happen to any user. "Oh I need to get a replacement WD10EADS drive for my system... what the heck?!?" This is going to confuse a lot of people, and caught me by surprise when I saw it. Shame on Western Digital for not adjusting the model string! Comparatively, the WD "EARS"-model drives, however, have always been 4KByte physical / 512 byte logical. The logical size is set to 512 to ensure full compatibility with existing and legacy OSes. I'm dreading the day the WD Caviar Black models succumb to all this nonsense. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |
Hi, On Thu, Aug 18, 2011 at 1:47 AM, Yuri <yuri@rawbw.com> 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?The FreeBSD driver detects 4k drives. At this time as far as I know all AF drives on market advertises 512-bytes sector rather than 4k (mostly for compatibility with BIOS, etc). If they advertise 4k sector natively, you don't have to do anything special but currently you need to make sure: - FS Partitions starts at a 4k boundary; - FS is aware of 4k sector, e.g. through gnop -S 4k for ZFS, which will remember this so you don't have to do that at later time. For UFS you may want to specify larger fragment size and block size (4k/32k for example). Some newly developed application like FreeNAS already detect this and make adjustment for you by default. We need to check and make sure that our base system tools, especially installer, would do that though. Cheers, -- Xin LI <delphij@delphij.net> https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die
Marc Fonvieille
2011-Aug-18 10:09 UTC
WD Advanced Format: do I need to do something special?
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
Following instructions here (http://ivoras.net/blog/tree/2011-01-01.freebsd-on-4k-sector-drives.html) I destroyed my previous ZFS pool with 512 byte sectors and did this: gnop create -S 4096 /dev/ad4 zpool create mypool /dev/ad4.nop zpol create mypool/mydir zpool export mypool gnop destroy /dev/ad4.nop zpool import mypool Now this command 'zdb -C data | grep ashift' shows ashift=12 (4096 byte sectors). However, when I begin to copy a lot of files files into /mypool/mydir online radio player gets severely affected. Sound get interrupted all the time. Itrettuptions stop after 1-2 secs after I stop copying. This didn't happen with sector size 512 bytes. What is wrong? Yuri