Creating a directory in /home on MacOS Sierra

I have this PHP old legacy code that I have inherited. There is hardcode references to /home/project everywhere I can not change them.

I am on MacOS/Sierra and it will not let me create a folder in /home

sudo mkdir /home/myproj

mkdir: /home/myproj: Operation not supported

I am not new to Linux but new to MacOS

I tried sudo as well and still will not let me.

I also thought maybe a symlink but still not allowed.

I tried disabling SIP

$ csrutil status
System Integrity Protection status: disabled.

I still get the same error

mkdir: /home/foo: Operation not supported

Solution 1:

IIRC /home and /net can be used by directory services like AD or OD. They are mount points created by the auto_master file. Usually they are not used for anything - especially on non-corporate Macs.


Comment out the line /home auto_home -nobrowse,hidefromfinder in the file /etc/auto_master and enter sudo automount -vc or reboot.

Then you should be able to create /home and any further subdir with sudo mkdir -p /home/subdir.

If you are done with your PHP legacy code remove the folder /home and its content and restore the old auto_master file by uncommenting the /home line.