I read on the HFS Plus Wikipedia page that the default sector size on a Mac is 512 b. However, I also read that Macs support 4kb sectors. How can I determine which I have, 512 b or 4 kb sectors? I think 512 is the right answer, but I would like to be sure.


5 Answers 5


In terminal, you can use diskutil to get information about the drive, including the device block size:

$ diskutil info / | grep "Block Size"
  Device Block Size:        512 Bytes
  • 1
    Thanks Timothy - didn't know about this command. Looks like a treasure trove for disk information / manipulation under OS X.
    – Kyle L
    Commented Jan 15, 2013 at 2:10
  • 1
    Caution: this answer doesn't distinguish between device block size and allocation block size. They may be very different, and the allocation block size may well be what the OP is looking for, since it's what the filesystem uses. See Mike's answer.
    – LarsH
    Commented May 21, 2018 at 16:57
  • 1
    ... and it doesn't address the OP's question either - which asked about sector, not block size.
    – Seamus
    Commented Jan 25, 2022 at 22:29

First, note that Device Block Size is different from the block size in use by the filesystem. The former value as reported by diskutil refers to the raw block size used by the hardware. I haven't found an easy way to check the latter value by the command line, but you can just create a zero-byte file then do Get Info from the Finder. It will say 0 bytes, but 4k used on disk.

Second, you can create an HFS+ filesystem with larger than 4k block sizes using the command line program newfs_hfs. The easiest way is to use Disk Utility to partition the drive and create a partition with the default formatting, then use /bin/df to determine the block device (an example only: /dev/disk0s2). Then unmount that partition (using umount /dev/diskXXX or Disk Utility), and to reformat as HFS+ with 64k blocks do:

newfs_hfs -v VolumeName -b 65536 /dev/disk0s2

Use the Get Info tip above to verify that a small file now occupies 64k on disk (it may say 65k for powers-of-10 units).

Performance is the main reason you might want to do this, if most of the data to be stored are large files (such as MP3s, photo, video, .zip files, etc), and it also helps with keeping disk fragmentation low. Obviously don't bother if you plan on storing mostly small files.

I have found that on large drives (> 1 TB) formatted as HFS with the default 4k block size, when the drive nears capacity, write performance degrades terribly. I'm guessing that is due to the partition being fragmented and having to hunt and peck for free blocks in order to write out the last 1% of data. I'm hoping that larger block sizes will alleviate this problem somewhat.

  • 1
    The filesystem block size is given by stat -f %k ..
    – lhf
    Commented Jun 26, 2013 at 16:58
  • Also: it's easier on the drive if your file system block size matches the physical block size of the drive. Otherwise, each write has to actually be a read-modify-write cycle, (Caching helps, of course.) Commented Sep 13, 2016 at 4:54
  • 1
    Re: "I haven't found an easy way to check the latter value by the command line" I don't know about older versions, but on macOS Sierra 10.12.6, diskutil info will sometimes tell you the allocation block size: Allocation Block Size: 32768 Bytes as well as the Device block size. I found this to be true when using the raw device rdisk2s0 with an SD card in the card reader. I don't know how to make it work for the hard drive.
    – LarsH
    Commented May 21, 2018 at 16:59

The OS X device block size can be determined by executing the following command from a Terminal window prompt:

diskutil info / | grep "Block Size"

Which will output the following information:

Device Block Size: 512 Bytes

The file system block size can be determined by using the stat utility:

stat -f %k .

Which will show you the Optimal file system I/O operation block size in bytes:


With the older HFS file system, Apple's second attempt at a file system for the Macintosh, there could only be up to 65,535 allocation blocks on a disk. The block size was a function of the disk size in bytes divided by the maximum number of allocation blocks, 65,535. For small disks this was fine, but when disk sizes started to approach 1GB in size the minimum allocation block size was 16 KB (1073741824 / 65535) = 16384.25, but you need to truncate to 16384.

What this means is that a 1 byte file on a 1GB HFS disk required 16,384 bytes to store on the hard drive, so there was too much wasted space. So Apple created the HFS+ wrapper to reduce the wasted space.

There may be a way to set the block size higher, but why would you want to?

Here is a quick bash script that will list all of the diskinfo output for all of your currently connected disks.


for disk in /dev/disk*s*
    diskutil info $disk
    echo "**************************************************************************************"
    echo " "
  • Thank you for your response, Mark, but I think you may have misunderstood my question. I am looking for what the size of a block on HFS Plus (the current default filesystem for Macs) is. That is interesting about the failings of HFS, though.
    – Kyle L
    Commented Jan 15, 2013 at 2:09
  • The point is that it varies, but is seems to be generally 512 bytes.
    – Ɱark Ƭ
    Commented Jan 15, 2013 at 12:33

Looks like the device block size is now 4096 bytes in the 2017 iMacs (iMac18,1), causing problems for people using ntfsprogs.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .