An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Topic Options
#8379 - 02/14/10 09:58 AM how does snow like 4k sector blocks?
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
WD green drives are going to 4096 byte (4k) disk blocks, from the previous almost exclusive 512 bytes, to make numerous improvements, mostly in capacity and speed.

There's an article running on /. right now about how everyone but unix is ready for this, and specifically mentions problems with fsck and severe performance hits when block reads don't align with the new disk blocks.

Seeing as how OS X is unix-based, where does Snow Leopard sit with these new drives? I'm interested not only in basic compatibility, but also what accessories like diskutil and fsck may break, as well as what performance we should expect?

One other gorey detail the thread goes into is questioning what happens to performance when the start of a partition is not aligned with a disk block. (apparently having consequences in calculating where every other data block in the partition is)
_________________________
I work for the Department of Redundancy Department

Top
#8382 - 02/14/10 01:53 PM Re: how does snow like 4k sector blocks? [Re: Virtual1]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
I'm no expert, but i doubt we have a problem here...

Originally Posted By: Technical Note TN1150
Terminology

HFS Plus is a specification of how a volume (files that contain user data, along with the structure to retrieve that data) exists on a disk (the medium on which user data is stored). The storage space on a disk is divided into units called sectors. A sector is the smallest part of a disk that the disk's driver software will read or write in a single operation (without having to read or write additional data before or after the requested data). The size of a sector is usually based on the way the data is physically laid out on the disk. For hard disks, sectors are typically 512 bytes. For optical media, sectors are typically 2048 bytes.

Most of the data structures on an HFS Plus volume do not depend on the size of a sector,
with the exception of the journal. Because the journal does rely on accessing individual sectors, the sector size is stored in the jhdr_size field of the journal header (if the volume has a journal).

HFS Plus allocates space in units called allocation blocks;
an allocation block is simply a group of consecutive bytes. The size (in bytes) of an allocation block is a power of two, greater than or equal to 512, which is set when the volume is initialized. This value cannot be easily changed without reinitializing the volume. Allocation blocks are identified by a 32-bit allocation block number, so there can be at most 2^32 allocation blocks on a volume. Current implementations of the file system are optimized for 4K allocation blocks.

Now i realize that sector != allocation block ( necessarily! )... but i think the bottom line is: HFS+ was designed around pretty much everything being stored and accessed in terms of 4-kilobyte clumps already. [iirc, 4K was an "optimum size/compromise" that Apple settled on when they released HFS+ for System 8.1 (in anticipation of drive sizes growing larger and larger with each year).]

--

A simple way of witnessing this is to save a small plain text file with TextEdit. Just type 123 and save it. Then Get Info with Finder...

Untitled
Kind: Plain text
Size: 4 KB on disk (3 bytes)

That's right, the data is only 3 bytes in length... but HFS+ insists on a minimum of 4096 bytes being allocated for any item. (not 4, 8, 16, 32, 64, 128, 512, 1024 or 2048).

4096.

[edit: and if some file gets as large as 4097 bytes, that would then require 2 allocation blocks on disk... or 8192 bytes.]


Edited by Hal Itosis (02/14/10 02:45 PM)

Top
#8385 - 02/14/10 03:31 PM Re: how does snow like 4k sector blocks? [Re: Virtual1]
_Mike_ Offline


Registered: 12/02/09
Loc: Bemke, Germany
Besides the fact that SCSI drives formated with sector sizes >512 bytes did work in the old days of OS7 (I tried that), I can report that a WD10EARS is doing fine in my MDD running Tiger.
Also, WDC says their "newly" formated drives are ok on current Macs:
http://www.wdc.com/en/products/advancedformat/

Top
#8387 - 02/14/10 04:12 PM Re: how does snow like 4k sector blocks? [Re: Virtual1]
alternaut Offline

Moderator

Registered: 08/04/09
FWIW, all my drives are formatted with block sizes of 4096 bytes, including the stock WD2500JS in my 20" G5 iMac iSight. Seems like the default. Of course, there's nothing particularly green nor snowy about these drives...
_________________________
alternaut moderator

Top
#8396 - 02/15/10 10:13 AM Re: how does snow like 4k sector blocks? [Re: Virtual1]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Originally Posted By: Virtual1
There's an article running on /. right now

A link would have been nice. mad

Anyway... after searching a bit, it seems slashdot has batted this topic around before:
  1. Changes in HDD Sector Usage After 30 Years -- Mar 24, 2006

  2. HDD Manufacturers Moving To 4096-Byte Sectors -- Dec 28, 2009

  3. Linux Not Quite Ready For New 4K-Sector Drives -- Feb 14, 2010

Top
#8404 - 02/15/10 05:16 PM Re: how does snow like 4k sector blocks? [Re: _Mike_]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
Originally Posted By: _Mike_
Besides the fact that SCSI drives formated with sector sizes >512 bytes did work in the old days of OS7 (I tried that), I can report that a WD10EARS is doing fine in my MDD running Tiger.
Also, WDC says their "newly" formated drives are ok on current Macs:
http://www.wdc.com/en/products/advancedformat/


It's not so much a question of hardware than of software. In particular, performance hits. It works, it just sometimes can be dog slow
_________________________
I work for the Department of Redundancy Department

Top
#8434 - 02/17/10 06:53 AM Re: how does snow like 4k sector blocks? [Re: Virtual1]
_Mike_ Offline


Registered: 12/02/09
Loc: Bemke, Germany
Originally Posted By: Virtual1
...It's not so much a question of hardware than of software. In particular, performance hits...
I totally agree.
What I ment by "doing fine" is that for me it is just not showing any drawbacks (like occasional noticeable performance hits, etc.). So hardware and software seem to cooperate quite well.
Transfer rates are well above 80 MB/s for both reading and writing (disk is 21% full) - not too bad for a drive which is tuned for lower power consumption (Caviar Green), and I never got the feeling that the drive was just taking a coffee break.

Top

Moderator:  alternaut, dkmarsh, joemikeb