Changed home directory and won’t load up

Hi,


I am new to Mack, and have just changed home directory from and long name to a two letters, it asked me to restart and since then it stuck in below screen.


after giving the username and password I stays loading forever.


I have googled and watched some YouTube videos, I realised I was not supposed to do that on my admin account and should’ve created a new account then changing my admin home directory, so long story short, is there anyway I can log back into my laptop without resetting everything/re-installing mcOS??


thanks you :)


Posted on Mar 13, 2021 11:31 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 14, 2021 9:35 PM

I'm a bit confused on what you changed. It should be perfectly safe to change the long user name, but changing the short user name must be performed using another admin account using these Apple instructions:

https://support.apple.com/en-us/HT201548


To fix the problem now is a lot more difficult since you will need to boot into Recovery Mode (Command + R for an Intel Mac). Launch the Terminal app from the Utilities menu.


You will need to first disable System Integrity Protection (SIP) by issuing the following command (press the "Return" key at the end of each line to execute the commands):

csrutil  disable


Make sure to re-enable SIP before rebooting so that your Mac is secure, otherwise bad things can happen (instructions are included later).


Now you need the volume name for your macOS boot volume. You can see a list of possible volume names where you should be able to recognize the macOS volume if it was renamed at some point from the macOS default of "Macintosh HD". Use the following command to see a list of volume names:

mount  |  grep  -i  volumes


Here is a command template to delete the ".AppleSetupDone" file which prevents Setup Assistant from running at boot time. Make sure to replace "Macintosh HD" in my example command with the actual volume name for your Mac's boot volume.

rm  -i  "/Volumes/Macintosh HD/var/db/.AppleSetupDone"


You will be prompted to confirm you want to delete the ".AppleSetupDone" file. You will need to type "y" or "n" for "yes" or "no". You also need to press the "Return" key to submit the response.


Now re-enable SIP (very important for the security of your Mac):

csrutil  enable


Now reboot the Mac. You should now be greeted with Setup Assistant which will walk you through creating a new admin account. Once booted into the new admin account you can follow the Apple instructions to fix your main admin user account:

https://support.apple.com/en-us/HT201548


I'm writing this guide from memory. It has been a while since I have written up these instructions and personally tried it. I've never done this with Big Sur, but I did try it a couple years ago with Catalina which is very similar.


Your other option is to restore from a backup made before you attempted to change the user account name.


You should always have frequent & regular backups.

Similar questions

1 reply
Question marked as Top-ranking reply

Mar 14, 2021 9:35 PM in response to Sakhi_Hussaini

I'm a bit confused on what you changed. It should be perfectly safe to change the long user name, but changing the short user name must be performed using another admin account using these Apple instructions:

https://support.apple.com/en-us/HT201548


To fix the problem now is a lot more difficult since you will need to boot into Recovery Mode (Command + R for an Intel Mac). Launch the Terminal app from the Utilities menu.


You will need to first disable System Integrity Protection (SIP) by issuing the following command (press the "Return" key at the end of each line to execute the commands):

csrutil  disable


Make sure to re-enable SIP before rebooting so that your Mac is secure, otherwise bad things can happen (instructions are included later).


Now you need the volume name for your macOS boot volume. You can see a list of possible volume names where you should be able to recognize the macOS volume if it was renamed at some point from the macOS default of "Macintosh HD". Use the following command to see a list of volume names:

mount  |  grep  -i  volumes


Here is a command template to delete the ".AppleSetupDone" file which prevents Setup Assistant from running at boot time. Make sure to replace "Macintosh HD" in my example command with the actual volume name for your Mac's boot volume.

rm  -i  "/Volumes/Macintosh HD/var/db/.AppleSetupDone"


You will be prompted to confirm you want to delete the ".AppleSetupDone" file. You will need to type "y" or "n" for "yes" or "no". You also need to press the "Return" key to submit the response.


Now re-enable SIP (very important for the security of your Mac):

csrutil  enable


Now reboot the Mac. You should now be greeted with Setup Assistant which will walk you through creating a new admin account. Once booted into the new admin account you can follow the Apple instructions to fix your main admin user account:

https://support.apple.com/en-us/HT201548


I'm writing this guide from memory. It has been a while since I have written up these instructions and personally tried it. I've never done this with Big Sur, but I did try it a couple years ago with Catalina which is very similar.


Your other option is to restore from a backup made before you attempted to change the user account name.


You should always have frequent & regular backups.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Changed home directory and won’t load up

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.