Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2010 13:21:41 -0500
From:      Scot Hetzel <swhetzel@gmail.com>
To:        Jeremy Chadwick <freebsd@jdc.parodius.com>
Cc:        Kirk McKusick <mckusick@mckusick.com>, freebsd-fs@freebsd.org, Andriy Gapon <avg@freebsd.org>, freebsd-geom@freebsd.org
Subject:   Re: g_vfs_open and bread(devvp, ...)
Message-ID:  <790a9fff1003261121p5d72e74bw61d0a66a7d418aae@mail.gmail.com>
In-Reply-To: <20100326161539.GA10618@icarus.home.lan>
References:  <4BACB3F5.7010905@freebsd.org> <201003261528.o2QFSAuI037251@chez.mckusick.com> <20100326161539.GA10618@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 26, 2010 at 11:15 AM, Jeremy Chadwick
<freebsd@jdc.parodius.com> wrote:
> On Fri, Mar 26, 2010 at 08:28:10AM -0700, Kirk McKusick wrote:
>> I have reviewed your change and I believe that your analysis is
>> correct. I am in agreement with your making the change.
>>
>> As disk sector sizes will be growing in the near future, it would
>> be desirable to get away from having DEV_BSIZE hard-coded. But as
>> you note, that is a far bigger change than this one.
>
> I should note that they already have grown: Western Digital, as of a few
> months ago, began shipping drives that use 4KByte sectors. =A0They're
> known as the "EARS" drives, due to their model string ending with
> "EARS":
>
> WD20EARS: http://www.wdc.com/en/products/Products.asp?DriveID=3D773
> WD15EARS: http://www.wdc.com/en/products/products.asp?driveid=3D772
> WD10EARS: http://www.wdc.com/en/products/products.asp?driveid=3D763
>
> (I should warn folks these are Caviar Green drives, which may suffer
> from excessive Load Cycles (parking/unparking actuator arm). =A0I don't
> have one of these drives so I can't validate if the issue happens on
> this model or not)
>
> A discussion and an including an incredibly cheesy video review are
> below. =A0The video review does discuss the 4KB sector size, in addition
> to jumpers that revert the drive to using 512-byte sectors for older
> OSes such as Windows XP -- and presumably FreeBSD.
>
> http://www.tomshardware.com/reviews/wd-4k-sector,2554.html
> http://www.youtube.com/watch?v=3DQeFj2QTaA3Y
>
After reviewing these links, my understanding of these drives that
they still provide 512 Byte sectors to the O/S, but when they write to
the drive, it will pack eight 512 Byte sectors into a 4K sector on the
drive.  When the drive needs to modify a sector it has to read the
entire 4K sector before writing the change to the drive.  This could
lead to excessive Read-Modify-Writes if the partition is not aligned
on a 4K sector as it will will reduce the performance of these drives.
 Each partition must be aligned to start and end on a 4K sector.

The problem with Windows XP, is that it always creates the first
partition starting at sector 63, which is not on a 4k boundary.  When
the jumpers are set, the drive adds 1 to all 512 byte sector request.
For example, the OS asks for sector 63, the drive returns the contents
of sector 64, thus forcing the alignment of the partitions to start at
a 4K sector.

The other option is to use the WD align program on Windows XP.  This
software re-aligns the partions and data so that they are aligned to
the 4k sector.

In order for FreeBSD to use these drives, you just need to ensure that
all slices/partitions start at a 4k boundary.

Scot



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff1003261121p5d72e74bw61d0a66a7d418aae>