Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

How can I find out the HFS+ filesystem blocksize for a local volume on a MacbookPro5,4. I think its 4k. I need to confirm this. Diskutil reports that the disk blocksize is 512 bytes.

share|improve this question
add comment

migrated from serverfault.com Mar 4 '12 at 14:16

This question came from our site for professional system and network administrators.

2 Answers

You could try "stat" with the "%k" format option. According to the man page this is the "Optimal file system I/O operation block size". Command line is:

stat -f "%k" FILE

Where "FILE" is any regular file on your system (e.g. "~/.profile"). It should say "4096" or something like that. I cannot 100% guarantee this is what you're looking for, but it seems close.

share|improve this answer
    
Hm, This looks pretty good. I'm not exactly sure if it reads the filesystem header or not but it seems to be giving a reasonable value. –  Brendan Anthony Inglese Mar 5 '12 at 0:25
add comment

That's a fair enough measurement, but the right way to do it would be to query the filesystem itself, which you can do programmatically by statfs(). Alternatively, you can read directly from the HFS volume header - a free tool called HFSleuth, at http://www.newosxbook.com/ - allows you to do just that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.