• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: 4Kn drives, allocation block size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 4Kn drives, allocation block size


  • Subject: Re: 4Kn drives, allocation block size
  • From: Mark Day <email@hidden>
  • Date: Fri, 15 Mar 2013 10:15:34 -0700

The short answer is bytes, not sectors.  But the sector size influences the allocation block size.

The size of an allocation block is a power of two bytes, and must be at least as large as the logical sector size as reported by the drive.  The default allocation block size depends on the total size of the volume.  The constraint is that we only have 32 bits to store allocation block numbers, so allocation block size needs to be large enough that when multiplied by 2^32 is greater than or equal to the total volume size.

For volumes in the gigabyte range, the default allocation block size is 4KiB.  As you get to terabytes and larger, we start to increase the default allocation block size.  I think it was in Mountain Lion that we adjusted the algorithm used by newfs_hfs to determine the default allocation block size.  We wanted to pick an allocation block size such that the volume could still grow its total size without running out of allocation blocks (so that if the user had partitioned a large drive, and then decided to merge the partitions, we could simply grow the file system and continue to use the same allocation block size).  Off hand, I'm not positive about that growth factor; I think it was 4X.

There's another wrinkle.  Some drives report different physical and logical sector sizes.  The common example is a hard disk that reports its logical sector size as 512 bytes, but actually uses 4096 bytes per sector internally.  They can optionally report their physical sector size.  If they do, we try to make sure the allocation block size is at least as large as that physical size (up to 4KiB) so that file content and metadata are conveniently aligned on physical sector boundaries.

Hope that helps.

-Mark

On Mar 15, 2013, at 9:59 AM, Chris Murphy <email@hidden> wrote:

Is the default HFSJ/X allocation block size defined as 4KB, or as 8 sectors?

I'm wondering if 4Kn allocation blocks will remain 4KB (1 sector), or become 32KB (8 sectors).



Chris Murphy

Do not post admin requests to the list. They will be ignored. Filesystem-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: 4Kn drives, allocation block size
      • From: Chris Murphy <email@hidden>
References: 
 >4Kn drives, allocation block size (From: Chris Murphy <email@hidden>)

  • Prev by Date: 4Kn drives, allocation block size
  • Next by Date: Re: 4Kn drives, allocation block size
  • Previous by thread: 4Kn drives, allocation block size
  • Next by thread: Re: 4Kn drives, allocation block size
  • Index(es):
    • Date
    • Thread