Skip to content

Instantly share code, notes, and snippets.

@taxilian
Last active December 2, 2019 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taxilian/0d20dca90fb1e4b3b8a9f39521b013d9 to your computer and use it in GitHub Desktop.
Save taxilian/0d20dca90fb1e4b3b8a9f39521b013d9 to your computer and use it in GitHub Desktop.
Creating a case sensitive code volume on macOS which auto mounts inside your home directory

Create /Users/<username>/code (or wherever you want it)

  1. Open Disk Utility; create a new volume:

    • APFS (Case Sensitive, Encrypted)
    • Put in the password; it won’t save yet
  2. Open terminal, run: sudo diskutil apfs list

    • Find the volume you created in the list; it’s probably the last item. Looks like this (volume CodeFS):

        Volume disk1s6 19927108-1370-4A52-840F-3AF7B9F5FB6D
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk1s6 (No specific role)
        Name:                      CodeFS (Case-sensitive)
        Capacity Consumed:         737280 B (737.3 KB)
        FileVault:                 Yes (Unlocked)
      
    • Grab the UUID from the end of the first line, copy it

  3. Run: sudo vifs

  • Add a new line to the end of the file; use the below but change the UUID and the path:

      UUID=19927108-1370-4A52-840F-3AF7B9F5FB6D /Users/richard/code apfs rw 0 2
    
  1. Mount the volume in disk utility; (right click and click “mount”). Tell it to save password unless you want it to ask each time you log in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment