Notes

Case-Sensitive APFS Sparse Image with hdiutil

· 1min

macOS’s default filesystem is case-insensitive. A separate case-sensitive volume is useful for codebases with files whose names differ only by capitalization, like the Linux kernel source. Walked through in How I Compiled and Ran a Linux Kernel for RISC-V on My Apple Silicon Mac.

Create a Sparse Image

hdiutil create -size 20g -fs "Case-sensitive APFS" \
  -volname linuxkernel ~/Learning/LINUX/linuxkernel.dmg

Attach the Image

Mounts at /Volumes/<volname>.

hdiutil attach ~/Learning/LINUX/linuxkernel.dmg

Detach the Image

hdiutil detach /Volumes/linuxkernel



Comments