An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Previous Thread
Next Thread
Print Thread
how does snow like 4k sector blocks?
#8379 02/14/10 05:58 PM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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
Re: how does snow like 4k sector blocks?
Virtual1 #8382 02/14/10 09:53 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
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.]

Last edited by Hal Itosis; 02/14/10 10:45 PM.
Re: how does snow like 4k sector blocks?
Virtual1 #8385 02/14/10 11:31 PM
Joined: Dec 2009
Offline

Joined: Dec 2009
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/

Re: how does snow like 4k sector blocks?
Virtual1 #8387 02/15/10 12:12 AM
Joined: Aug 2009
Likes: 1
Moderator
Offline
Moderator

Joined: Aug 2009
Likes: 1
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
Re: how does snow like 4k sector blocks?
Virtual1 #8396 02/15/10 06:13 PM
Joined: Sep 2009
Offline

Joined: Sep 2009
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

Re: how does snow like 4k sector blocks?
_Mike_ #8404 02/16/10 01:16 AM
Joined: Aug 2009
OP Offline

Joined: Aug 2009
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
Re: how does snow like 4k sector blocks?
Virtual1 #8434 02/17/10 02:53 PM
Joined: Dec 2009
Offline

Joined: Dec 2009
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.


Moderated by  alternaut, dkmarsh, joemikeb 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.4.33 Page Time: 0.421s Queries: 28 (0.017s) Memory: 0.6055 MB (Peak: 0.6819 MB) Data Comp: Zlib Server Time: 2024-04-18 03:36:05 UTC
Valid HTML 5 and Valid CSS