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
  • 1
    Since you can’t change the scripts - I’ll link this to an article on how to disable SIP. Even root can’t bypass folders protected thusly. – bmike Aug 19 '17 at 0:45
  • i followed the steps to disable SIP. Still same issue. i also updated the description to reflect the changes – randy Aug 19 '17 at 1:07
  • Let’s get this reopened. Perhaps it’s as simple as sudo mkdir -p /home/foo one time after you’ve loosened the SIP shackles. – bmike Aug 19 '17 at 1:16
  • The scripts I would guess assume some forms of Linux is /home how do you know that the /home is the only place they have assumed that. You need to look and change all the code to check it safely runs on Unix eg macros – mmmmmm Aug 20 '17 at 10:55

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.

  • Well done. I am a bit humbled that I confused NIS Automounter setup for SIP. Great write up. – bmike Aug 19 '17 at 3:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .