g_vfs_open and bread(devvp, ...)

Scot Hetzel swhetzel at gmail.com
Fri Mar 26 18:21:42 UTC 2010


On Fri, Mar 26, 2010 at 11:15 AM, Jeremy Chadwick
<freebsd at 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.  They're
> known as the "EARS" drives, due to their model string ending with
> "EARS":
>
> WD20EARS: http://www.wdc.com/en/products/Products.asp?DriveID=773
> WD15EARS: http://www.wdc.com/en/products/products.asp?driveid=772
> WD10EARS: http://www.wdc.com/en/products/products.asp?driveid=763
>
> (I should warn folks these are Caviar Green drives, which may suffer
> from excessive Load Cycles (parking/unparking actuator arm).  I 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.  The 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=QeFj2QTaA3Y
>
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


More information about the freebsd-geom mailing list