How can I specify a smaller block size for a Ramdisk? I use a ramdisk to speed up a git repository with a lot (> 60k) of small (~200 bytes) files.

Is there a way to create a ramdisk with a smaller block size?
Executive summary: I don't believe this is possible, at least not for volumes formatted as HFS+.

My current understanding is that HFS+ chooses its file system block size (separate from the physical device block size) according to a fixed default allocation block size that cannot be manually overruled.



Discussions in other forums spanning from 2002 to 2011 ( CompGroups, MacRumors among others) suggest using newfs_hfs(8), which has a -b &lt;blocksize&gt; option, to manually set the block size when creating a new file system.

I tried using newfs_hfs  on various kinds of partitions, on both .dmg diskimages and on physical SATA hard drives (through SATA&lt;->USB interface) and with various file systems (HFS+, FAT16, FAT32.)  When I ran newfs_hfs with different -b sizes (512, 1024, 2048, 4096, 8192,) indeed it reported success in creating the filesystems with the specified block sizes. I could mount &amp; read/write these volumes normally.

But when I examine the test volumes with diskutil info &lt;diskname&gt; (where &lt;diskname&gt; is disk1, disk4, or whatever your disk is), I always see:

Total Size:               104.9 MB (104857600 Bytes) (exactly 204800 512-Byte-Blocks)
Volume Free Space:        102.4 MB (102385664 Bytes) (exactly 199972 512-Byte-Blocks)
Device Block Size:        512 Bytes


Noting that the end of the newfs_hfs(8) man page includes this tidbit:

HISTORY
The newfs_hfs command appeared in Mac OS X Server 1.0 .  As of Mac OS X
10.6, this utility no longer generates HFS standard file systems.


It would appear that OS X 10.8 (and probably 10.7, and perhaps earlier versions) overrides whatever block size newfs_hfs claims to create, in favor of default sizes imposed by a higher authority. (??)



One article I came across suggested using OS X's software-RAID utility to create a RAID mirror. Software RAID allows one to specify a RAID stripe size, but as this is generally geared towards improving throughput for large files rather than tiny ones, I believe the minimum RAID stripe size is 4KB - not useful for your purposes.