Create a case sensitive disk image on macOS

From The Power of Many
Revision as of 02:10, 19 March 2022 by Snowshi (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

I need a 'Case-Sensitive' location on macOS.

$ hdiutil create -size 30g -type SPARSE -fs 'Case-sensitive APFS' -volname Projects ~/Projects.dmg
$ hdiutil attach ~/Projects.dmg.sparseimage
$ sudo setfile -a V /Volumes/Projects/
$ killall Finder
$ mkdir /Volumes/Projects/projects/
$ ln -s /Volumes/Projects/projects/ ~/projects


what happened?

- I created a new disk image with case sensitive filesystem. The type is ‘spare’ which means it will automatically grow when needed, but initially it will take only 50mb on disk.

- I mounted the image

- I hide it on the desktop (This volume will be always mounted, so I don’t want to see the icon of it) – for this I set the invisible attibute with setfile, and restarted Finder

- And finally I created the projects folder inside the volume, and linked it into my home directory.