Problem with WD Advanced Format drive in LINUX (WD15EARS)

I got a new harddrive with a bit more capacity for my stuff. It’s a brand new WD15EARS from Western Digital. This drive uses, as one of the first, the newer 4096 byte big sector size instead of the common 512 byte. This is indicated on a label on the package and also on the Harddrive including instructions what you have to do when you are using Windows XP to get the drive working properly. Read this Article for more information about 4k sector size HD’s 

The last sentence on the label is a lie:
All other OS configurations - drive is ready for use as is

Problem
I installed it yesterday, created a fresh partition table and EXT3 filesystem with gparted and startet to copy my data from the old disk to the new WD15EARS.

Write speed was horrible slow. As a patience person I gave the process a lot of time to finish but after 24 hours only 100 Gbyte was copied…
Very slow transfer rate of less then 1 Mbyte/s!!

Solution
Searching the Internet including the WD forum didn’t gave me an answer. So I tried to follow the instructions for using the HD with the old Windows XP: set jumpers 7-8 prior to installation or use WD Align SW

but no luck!

Where’s the Error?
For me it seems that the problem is that only the consumer but not his operating system knows about Advanced format:
hdparm -i /dev/sda

/dev/sda:

Model=WDC, FwRev=80.00A80, SerialNo=WD-WMAVU1361115
Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50
BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=1
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=2930277168
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
AdvancedPM=no WriteCache=enabled
Drive conforms to: Unspecified: ATA/ATAPI-1,2,3,4,5,6,7

The drive does NOT report his sector size so hdparm and all other tools suggest that it is 512 byte (You see this with hdparm -I /dev/sda), what will cause miss aligned filesystem blocks like described in the article above what happens with Windows XP.
More testing

Then I started playing arround with different partion tables (MS DOS and GPT) and different filesystems (EXT3, reiserfs, XFS). All the time it gave me the same result, exept XFS. Anytime you recognise that something is wrong during filesystem initialising because it is way slower than usual.

If you ask, yes it is a quite fresh Linux installation:

Linux zipf 2.6.31-5.slh.3-sidux-amd64 #1 SMP PREEMPT

nforce 430i chipset

hdparm v9.15
mke2fs 1.41.9 (22-Aug-2009) Using EXT2FS Library version 1.41.9
mkfs.xfs version 3.0.4

mkfs.reiserfs 3.6.21

Hi!

I have the same problem, you might want to have a look at this thread at util-linux-ng mailing list:

http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2926

BTW, could you try manually aligning the GPT partition?

See below how to do this in parted:

# parted /dev/sdX
# Set units to sectors (in this case 512B):
(parted) unit s

(parted) rm
Partition number? 1

(parted) print
Model: ATA WDC WD15EARS-00Z (scsi)
Disk /dev/sdb: 2930277168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags

(parted) mkpart
Partition name? []?
File system type? [ext2]?
Start? 64
End? -1
Warning: You requested a partition from 64s to 2930277167s.
The closest location we can manage is 64s to 2930277134s.
Is this still acceptable to you?
Yes/No? Yes

(parted) print
Model: ATA WDC WD15EARS-00Z (scsi)
Disk /dev/sdb: 2930277168s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
 1 64s 2930277134s 2930277071s

(parted) quit
Information: You may need to update /etc/fstab.

This should align the partition’s start from the 32nd kilobyte (or should I say kibibyte?)

In the meantime I made some similar test like aadamowski and got the same conclusion:

You have to make shure YOURSELF that your partitions are aligned correctly to 4KiB boundries.

A detailed discussion about this topic on the linux kernel mailing list.

Here is a short manual how to create a correctly aligned partition with parted (thanks to aadamowski):

_(WARN__ING: the instructions below will likely destroy any data that’s
on the given drive, only do this with drives you’re intending to
erase):

parted /dev/YOUR_DEVICE_NAME

(parted) mklabel gpt

Here ^ I’ve chosen the GPT partition table format, but others may be

OK too - untested by me.

(parted) unit s

Here ^ we’re choosing sectors as units of measurement

(parted) mkpart primary ext2 40 -1

Here ^ we’re creating a partition that starts at sector 40, which is

divisible by 8.

You can also try 48, 56, 64 and others - these should offer the same

high performance,

but some space will go to waste - it’s only some tiny kilobytes, though.

Parted will likely complain about the end location of the ending sector:

Warning: You requested a partition from 40s to 2930277167s.
The closest location we can manage is 40s to 2930277134s.
Is this still acceptable to you?
Yes/No?

Of course, we answer Yes.

(parted) quit

After that, create a filesystem as usual, e.g:

mkfs.ext4 -T largefile4 /dev/YOUR_DEVICE_NAME

This should get the optimum performance from your 4 kB physical sector
drives even when they report 512 B sectors only to the OS._

If you prefer to use fdisk follow these steps (they come from ted):

 fdisk -H 224 -S 56 /dev/sdb

 running fdisk with these parameters ensures that every partition you create is aligned to 4KiB boundries.

Wenn du eine Anleitung auf  Deutsch benötigst, schau doch hier.

1 Like

Hopefully, WD will decide that it is necessery that a HDD reports it’s correct sector size to the OS. Else all the good efforts of the OS and HDD tool developers, like what they currently discuss at the Linux Kernel Mailinglist, is useless and an unknowing user will still get frustrated.

This should be fixed in an firmware update:

hdparm -i /dev/sda

/dev/sda:

Model=WDC, FwRev=80.00A80, SerialNo=WD-WMAVU1361115
Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
RawCHS=16383/16/63, TrkSize=0, SectSize=0 , ECCbytes=50
_ BuffType=unknown , BuffSize=0kB , MaxMultSect=16, MultSect=1_
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=2930277168
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
AdvancedPM=no WriteCache=enabled
Drive conforms to: Unspecified: ATA/ATAPI-1,2,3,4,5,6,7

 * signifies the current active mode 

Hello,

I also bought a WD15EARS drive. I’m totally frustrated. If you think to buy a WD drive and you will use Linux and Windows on those disk: LOOOK FOR AN OTHER DEVICE MANUFACTURE! Maybe you are a harddisk expert and you are motivated to invest many hours, than you can do it. I spend more then 20 hours for partition disk in a correct way with(!) a good performance. And I think every poster on this site too.

I tried the performance script from aadamowski and I can conform the performance problem with Linux. Setting the partitions to the correct borders, like suggested, you can’t use the disk with windows XP! The Windows System can not generate a NTFS on the disk.

I found out with the benchmark script from aadamowski, that the 10 time boost just work if your harddisk is configured with “R/W multiple sector transfer” of 16. By default on my Debian/unstable 64bit system (Kernel 2.6.32.7 with util-linux 2.17 it has the value 1. If I set it to 16 with:
hdparm --yes-i-know-what-i-am-doing -m 16 /dev/sdb
I’m getting the boost (and I don’t know what I am doing there ;-)).

I will give the device a last try, otherwise I will send it back. It’s just a harddisk (I thougt) :frowning:

Regards

    Daniel

BTW: Why is this thread marked as solved? There is a workaround but no solution. And for Linux and Windows I’m having no workaround.

Hi Daniel,


The person who started the thread is the one who can mark a post as the solution if it answered their question or solved the issue for them. 


-WendyM

Can you post your partition table here, so others could try to repeat your described problems with the ntfs partition?

I don’t use this drive for dual boot, so I don’t tested this kind of things. But it could be still a important problem to solve in regards to the pending patches for the linux fdisk and parted tools.

After investing some more hours in partitioning a harddisk I have a working setup.

Using the fdisk with -H 224 -S 56 /dev/sdb build a wrong harddisk with problems under windows XP. testdisk shows errors.

Make sure to delete the partitiontable with

dd if=/dev/zero of=/dev/sdb count=1 bs=1k

and create a new one with parted (see other postings). Then make sure to have them at a divide by 8 boundary.

I have to format them under Windows without(!) the quick/fast mode.

I’m still demotivated about the disk…

Hi !

I’ve recently bought a 1.5TB EARS drive, unaware of the 4kB sector issue. Glad I found this thread.

I tried the fdisk approach, followed by creating partitions in gparted but that left me with the partition starting at 63, which I assume is no good.

I then tried the parted approach, which meant I had one big partition, starting at 40. So far so good. But that’s not the layout I wanted, so I fired up gparted to modify the partition(s) to my requirements (2x 15GB, 1x for the rest).

I then ran into problems:

a) gparted didn’t let me create the first partition as 15GB, 22GB was the minimum. Why ?

b) Went ahead and created 1x22GB, 1x15GB, I for the rest.

When finished I noticed that the first partition now started at 63. I’m assuming that using gparted is the issue. Does this mean I have to use parted to create the partitions, making sure I specify start sectors divisible by 8 ? Why 8 ?

Thanks for any help.

BTW Here’s what I’m planning to do, can someone tell me if this will work:

mkpart primary ext2 40 3750000

I’m assuming this will create a partition from secot 40 to sector 3,750,000, which according to my calculations should be approx. 15GB

I would then create another partition like so

mkpart primary ext2 3750008 7,500,008

which hopefully creates another 15GB partition

Followed by

mkpart primary ext2 7500016 -1

which should create one more partition, taking up the rest of the space on the drive

Or am I going about this the wrong way ?

Hi,

I bought an external WD HD yesterday, a My Book Essential 1.5T. The HD in the box is a WDC WDC WD15EARS-00Z5B1

I was trying to follow and understand all the conversation here and there

http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/2926

But it is difficult to find a final answer. Below the result of hdparm.What matters seems to be:

    Logical  Sector size:                   512 bytes
    Physical Sector size:                  4096 bytes
    Logical Sector-0 offset:                  0 bytes

With these results, do I need to format my disk with a special method?

For now, I formated the disk using this command:

mkfs.ext3 -T largefile4 /dev/sdb1

But the following gives me:

cat /sys/block/sdb/alignment_offset
0

I would like to be sure that I did good before the disk is filled at 80%…

Here my debian config:

linux kernel 2.6.32-8

fdisk -V
fdisk (util-linux-ng 2.16.2)
parted --version
parted (GNU parted) 1.8.8.git-dirty

hdparm -I /dev/sdb/dev/sdb:ATA device, with non-removable media Model Number: WDC WD15EARS-00Z5B1 Serial Number: WD-WMAVUxxxxxxx Firmware Revision: 80.00A80 Transport: Serial, SATA 1.0a, SATA II Extensions, SATA Rev 2.5, SATA Rev 2.6Standards: Supported: 8 7 6 5 Likely used: 8Configuration: Logical max current cylinders 16383 16383 heads 16 16 sectors/track 63 63 -- CHS current addressable sectors: 16514064 LBA user addressable sectors: 268435455 LBA48 user addressable sectors: 2930277168 Logical Sector size: 512 bytes Physical Sector size: 4096 bytes Logical Sector-0 offset: 0 bytes device size with M = 1024*1024: 1430799 MBytes device size with M = 1000*1000: 1500301 MBytes (1500 GB) cache/buffer size = unknownCapabilities: LBA, IORDY(can be disabled) Queue depth: 32 Standby timer values: spec'd by Standard, with device specific minimum R/W multiple sector transfer: Max = 16 Current = 0 Recommended acoustic management value: 128, current value: 254 DMA: mdma0 mdma1 *mdma2 udma0 udma1 udma2 udma3 udma4 udma5 udma6 Cycle time: min=120ns recommended=120ns PIO: pio0 pio1 pio2 pio3 pio4 Cycle time: no flow control=120ns IORDY flow control=120ns

i wonder if its worth the time to try  find out, learn, figure out, understand what are you talking about in these 4k sector drives threads LOL

all and all i think those Green 4K hdd are not worth buying, unless you are some HDD guru and intend to use them only with an OS that can use them properly.  Same story with the SSDs as well, so complicated … Moving ahead technologically tries to automate and simplify and make more user friendly some aspects of the the previous generation while adds other complexities and absolute productivity killers about aspects of the forthcoming generation: summary = no change in productivity and user friendliness (ms is the best example of this phenomenon)

Hi community,

Have found a tutorial (source: http://www.brain4free.org/wiki/doku.php/blog:wd_advanced_format_hd_mit_linux), translated it from german:

Good description of the problem:

http://www.anandtech.com/storage/showdoc.aspx?i=3691&p=2

Using linux with WDxxEARS HDDs is possible but to install them correctly is a bit tricky:

For using WDxxEARS with linux no special software is required. But it is absolutely necessary to partition your HDD correctly. Under Windows XP or under linux using fdisk or parted with default settings WDxxEARS HDDs get partitioned incorrectly. To test, how and where your partitions got created, you  can use fdisk:

fdisk -l -u

A typical incorrect example will look like that:

Device Boot Start End Blocks Id System/dev/sdc1 63 2930272064 1465136001 83 Linux

It is absolutely necessary, that start- and end-parameter are divisible by 4. Default settings in fdisk, parted and Windows XP do not manage that problem. For Windows XP you need this separate Utility: http://www.wdc.com/en/products/advancedformat/index.asp

For linux, this tutorial will help:

http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/

fdisk using this parameters creates all partitions aligned to 4 KByte blockboundaries:

fdisk -H 224 -S 56 /dev/sdb

Create Partitions and for security reasons test them in the end.

gparted-gui does not work. You have to use parted in console. You have to ensure that your partitions begin and end at 4 KByte blockboundaries. You manage that by swiching parted showing all units in KByte. Dead shot exactly in Kibibyte ( http://en.wikipedia.org/wiki/Kibibyte). All Numbers you give in then have to be divisible by 4.

Example for an HDD with one partition (Notice the command “unit kib”):

parted /dev/sdb(parted) unit kib(parted) printModel: ATA WDC WD15EARS-00Z (scsi)Disk /dev/sdc: 1465138584kiBSector size (logical/physical): 512B/512BPartition Table: msdosNumber Start End Size Type File system Flags 1 31.5kiB 1465136032kiB 1465136001kiB primary xfs(parted) mkpartPartition type? primary/extended? pFile system type? [ext2]? xfsStart? 32End? 1465138584(parted) printModel: ATA WDC WD15EARS-00Z (scsi)Disk /dev/sdc: 1465138584kiBSector size (logical/physical): 512B/512BPartition Table: msdosNumber Start End Size Type File system Flags 1 32.0kiB 1465138584kiB 1465138552kiB primary

Hope this will help many people.

Best regards,

hans1967

hi dafrizz

i don’t know where your problem with the minimum size partition comes from (normally you get this behaviour for partitions with data on it. am I right that your partition was empty?)

we have to wait for some patches for parted and gparted, so the default behavior is fine for the new drives.

go ahead with parted and you should be fine. i didn’t checked your calculations but what you plan to do looks fine too me. you should get a properly performing drive by that.

hi klubad

please show us your partition details. do this by following what is described in the other posts:

To test, how and where your partitions got created, you can use fdisk:
fdisk -l -u

you only write that you formated the drive, who has created the partition on it? you or during manufacturing?

my guess is, that if you created the partition, you have to go over and follow the instructions here. If the partitioning was made during manufacturing you should be fine.

but thats a quess, please check AND POST your partition table, so we can provide correct instructions for newer My Book Essential drives.

Hi, I recently upgraded my DirecTV HD-DVR HR21 to use the 1.5 Terabyte WD15EARS hard drive.  The OS of the DirecTV receiver is linux.

Could someone help be with the commands to resize the XFS partitions that the DVR creates at bootup?  The output from “fdisk -l -u” is

Disk /dev/sda: 1500.3 GB, 1500301910016 bytes

255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors

Units = sectors of 1 * 512 = 512 bytes

Disk identifier: 0x00000000

Device           Boot            Start                    End                      Blocks                ID         System

/dev/sda1                           63                       1060289             530113+           82         Linux swap / Solaris

/dev/sda2                           1060290            32531624          16735667+      83         Linux

/dev/sda3                           32531625          2930272064     1448870220    83         Linux

When I open the device in G-Parted, sda1 and sda3 show up as unknown, sda2 shows up as xfs.  I must be missing some libraries for g-parted not to identify sda1 and sda3.

Thanks,
Zack      

Well, I repartitioned the whole drive and this time didn’t have any issues with any minimum sizes. This is the output from fdisk -l -u afterwards:

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x000350f8

   Device Boot Start End Blocks Id System
/dev/sdb1 64 30716279 15358108 83 Linux
/dev/sdb2 30716280 61432559 15358140 83 Linux
/dev/sdb3 63472816 2930272064 1433399624+ 83 Linux
/dev/sdb4 61432560 63472814 1020127+ 82 Linux swap / Solaris

Partition table entries are not in disk order

Looks to me like the partitions are properly aligned.

Hi,

You can also use LVM to solve the problem:

x64etch:~# hdparm -i /dev/sdc
/dev/sdc:
 Model=WDC WD20EARS-00S8B1, FwRev=80.00A80, SerialNo=WD-WCAVY2798944
 Config={ HardSect NotMFM HdSw>15uSec SpinMotCtl Fixed DTR>5Mbs FmtGapReq }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=50
 BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=16
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=3907027055
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio3 pio4
 DMA modes:  mdma0 mdma1 mdma2
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
 AdvancedPM=no WriteCache=enabled
 Drive conforms to: Unspecified:  ATA/ATAPI-1,2,3,4,5,6,7

1/ delete all partition

x64etch:~# fdisk /dev/sdc
Delete all partition
w

2/ Install lvm (i use debian)

x64etch:~# apt-get install lvm2 dmsetup mdadm

3/ spend a little time to read the man page :slight_smile:

x64etch:~# man pvcreate
    …
    If the 2nd SCSI disk is a 4KB sector drive that compensates for windows partitioning (sector 7 is the lowest aligned logical block, the 4KB sectors start at LBA -1, and consequently sector 63 is
    aligned on a 4KB boundary) manually account for this when initializing for use by LVM:
        pvcreate --dataalignmentoffset 7s /dev/sdb
    …

4/ Prepare the disk

x64etch:~# pvcreate --dataalignmentoffset 7s /dev/sdc
  Physical volume “/dev/sdc” successfully created

5/ Create a volume group

x64etch:~# vgcreate wd2tsata /dev/sdc
  Volume group “wd2tsata” successfully created

6/ and the end create the logical volume

x64etch:~# lvcreate --name vm_storage --size 300G wd2tsata
  Logical volume “vm_storage” created

7/ Format your logical volume

x64etch:~# mkfs.ext4 /dev/wd2tsata/vm_storage

You can change the size has you want. I use the disk on samba file server, and i transfert 4.4 G on it by network share in 45 seconds. I update later the post if i found a problem during the time of used.

have fun.

Source:

http://www.howtoforge.com/linux_lvm

http://www.wdc.com/wdproducts/library/WhitePapers/FRA/2579-771430.pdf

http://www.mentby.com/mike-snitzer-2/data-alignment.html

Stams